------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  all
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- 20 Apr 2025.log
  log type:  text
 opened on:  20 Apr 2025, 13:35:00
.         log using "JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log", replace name(app)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 opened on:  20 Apr 2025, 13:35:00
.         log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
. 
.         * get data -- has all of the actuarial parameters and dnh_data
.         use ALL_insurance_EUT_2024, clear
. 
. }

. 
. * graphics scheme
. set scheme s1mono

. set scheme s1color

. 
. ////////////////////////////////////////////////////////////////////////////////
> /////////////////////// Create EFF_REG for EUT, EUT+RDU, REC ///////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. * get data -- has all of the actuarial parameters and dnh_data
. if "$doDirectory" == "y" {
.         use "$data/ALL_insurance_EUT_2024", clear
. }

. else {
.         use ALL_insurance_EUT_2024, clear
. }

. keep if insurance == 1
(17,371 observations deleted)

. 
. * predicted to buy
. generate int buyP = 0

. replace buyP = 1 if ceDiff_eut_I > 0
(1,979 real changes made)

. 
. * compare predicted to buy and actual buy
. generate correct_eut = 0

. replace correct_eut = 1 if buyP == buy
(4,783 real changes made)

. label variable correct_eut "Correct choices made, given EUT risk preferences"

. 
. replace buyP = 1 if ceDiff_rduPR_I > 0
(1,827 real changes made)

. generate correct_rdu = 0

. replace correct_rdu = 1 if buyP == buy
(5,444 real changes made)

. label variable correct_rdu "Correct choices made, given RDU risk preferences"

. 
. tab correct_eut

    Correct |
    choices |
made, given |
   EUT risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      6,125       56.15       56.15
          1 |      4,783       43.85      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. tab dnh_data correct_eut, row nofreq

 Data from | Correct choices made,
       DNH |    given EUT risk
experiment |      preferences
 s in 2019 |         0          1 |     Total
-----------+----------------------+----------
         0 |     56.15      43.85 |    100.00 
         1 |     56.15      43.85 |    100.00 
-----------+----------------------+----------
     Total |     56.15      43.85 |    100.00 

. tab dnh_data correct_eut, exact

 Data from | Correct choices made,
       DNH |    given EUT risk
experiment |      preferences
 s in 2019 |         0          1 |     Total
-----------+----------------------+----------
         0 |     3,093      2,415 |     5,508 
         1 |     3,032      2,368 |     5,400 
-----------+----------------------+----------
     Total |     6,125      4,783 |    10,908 

           Fisher's exact =                 1.000
   1-sided Fisher's exact =                 0.505

. 
. tab correct_rdu

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      5,464       50.09       50.09
          1 |      5,444       49.91      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. tab dnh_data correct_rdu, row nofreq

 Data from | Correct choices made,
       DNH |    given RDU risk
experiment |      preferences
 s in 2019 |         0          1 |     Total
-----------+----------------------+----------
         0 |     49.78      50.22 |    100.00 
         1 |     50.41      49.59 |    100.00 
-----------+----------------------+----------
     Total |     50.09      49.91 |    100.00 

. tab dnh_data correct_rdu, exact

 Data from | Correct choices made,
       DNH |    given RDU risk
experiment |      preferences
 s in 2019 |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,742      2,766 |     5,508 
         1 |     2,722      2,678 |     5,400 
-----------+----------------------+----------
     Total |     5,464      5,444 |    10,908 

           Fisher's exact =                 0.515
   1-sided Fisher's exact =                 0.263

. 
. * now merge in the various efficiency measures
. sort dnh_data SID insurance period

. 
. * merge
. if "$doDirectory" == "y" {
.         merge 1:1 dnh_data SID insurance period using "$data/ALL_efficiency_2024.dta", keepusing(eff_reg_EUT eff_reg_sdEUT eff_reg_RDU eff_reg_recRDU) 
. }

. else {
.         merge 1:1 dnh_data SID insurance period using ALL_efficiency_2024, keepusing(eff_reg_EUT eff_reg_sdEUT eff_reg_RDU eff_reg_recRDU) 
(variable insurance was byte, now int to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             0
    Matched                            10,908  (_merge==3)
    -----------------------------------------
. }

. keep if _merge == 3
(0 observations deleted)

. count
  10,908

. drop _merge

. 
. tab dnh_data, missing

  Data from |
        DNH |
experiments |
    in 2019 |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      5,508       50.50       50.50
          1 |      5,400       49.50      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646          0 |     2,646 
         1 |     2,862          0 |     2,862 
         . |         0      5,400 |     5,400 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab full dnh_data, missing

     Index |
 insurance |     Data from DNH
      Full |  experiments in 2019
 treatment |         0          1 |     Total
-----------+----------------------+----------
         0 |         0      3,726 |     3,726 
         1 |         0      1,674 |     1,674 
         . |     5,508          0 |     5,508 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. 
. * in DNH Full is the same as the OLD II treatment 
. replace ii = 0 if dnh_data == 1
(5,400 real changes made)

. replace ii = 1 if dnh_data == 1 & full == 1
(1,674 real changes made)

. drop full

. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646      3,726 |     6,372 
         1 |     2,862      1,674 |     4,536 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. 
. ////////////////////////////////////////////////////////////////////////////////
> ///////////////////////Merge ROCL violations variables       ///////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. * drop rocl_subj_viol, to ensure a clean merge
. des rocl_*

Variable      Storage   Display    Value
    name         type    format    label      Variable label
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rocl_ae         byte    %8.0g                 One option is simple and the other is the actuarially-equivalent simple lottery
rocl_don        byte    %8.0g                 One option is simple and one is compound (Double Or Nothing)
rocl_aedon      byte    %8.0g                 One option is the actuarially-equivalent simple lottery and the other is the com
rocl_choice1    int     %8.0g                 
rocl_choice2    int     %8.0g                 
rocl_choice3    int     %8.0g                 
rocl_choice4    int     %8.0g                 
rocl_choice5    int     %8.0g                 
rocl_choice6    int     %8.0g                 
rocl_choice7    int     %8.0g                 
rocl_choice8    int     %8.0g                 
rocl_choice9    int     %8.0g                 
rocl_choice10   int     %8.0g                 
rocl_choice11   int     %8.0g                 
rocl_choice12   int     %8.0g                 
rocl_choice13   int     %8.0g                 
rocl_choice14   int     %8.0g                 
rocl_choice15   int     %8.0g                 
rocl_subj_viol  int     %8.0g                 ROCL Violation Count
rocl_subj_viol2 int     %8.0g                 ROCL Violation Count, squared

. drop rocl_subj_viol rocl_subj_viol2

. capture: drop iiae_v*

. 
. * check if dnh_data is here
. tab dnh_data, missing

  Data from |
        DNH |
experiments |
    in 2019 |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      5,508       50.50       50.50
          1 |      5,400       49.50      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. tab SID dnh_data, missing

           |     Data from DNH
           |  experiments in 2019
 group(id) |         0          1 |     Total
-----------+----------------------+----------
         1 |        54         54 |       108 
         2 |        54         54 |       108 
         3 |        54         54 |       108 
         4 |        54         54 |       108 
         5 |        54         54 |       108 
         6 |        54         54 |       108 
         7 |        54         54 |       108 
         8 |        54         54 |       108 
         9 |        54         54 |       108 
        10 |        54         54 |       108 
        11 |        54         54 |       108 
        12 |        54         54 |       108 
        13 |        54         54 |       108 
        14 |        54         54 |       108 
        15 |        54         54 |       108 
        16 |        54         54 |       108 
        17 |        54         54 |       108 
        18 |        54         54 |       108 
        19 |        54         54 |       108 
        20 |        54         54 |       108 
        21 |        54         54 |       108 
        22 |        54         54 |       108 
        23 |        54         54 |       108 
        24 |        54         54 |       108 
        25 |        54         54 |       108 
        26 |        54         54 |       108 
        27 |        54         54 |       108 
        28 |        54         54 |       108 
        29 |        54         54 |       108 
        30 |        54         54 |       108 
        31 |        54         54 |       108 
        32 |        54         54 |       108 
        33 |        54         54 |       108 
        34 |        54         54 |       108 
        35 |        54         54 |       108 
        36 |        54         54 |       108 
        37 |        54         54 |       108 
        38 |        54         54 |       108 
        39 |        54         54 |       108 
        40 |        54         54 |       108 
        41 |        54         54 |       108 
        42 |        54         54 |       108 
        43 |        54         54 |       108 
        44 |        54         54 |       108 
        45 |        54         54 |       108 
        46 |        54         54 |       108 
        47 |        54         54 |       108 
        48 |        54         54 |       108 
        49 |        54         54 |       108 
        50 |        54         54 |       108 
        51 |        54         54 |       108 
        52 |        54         54 |       108 
        53 |        54         54 |       108 
        54 |        54         54 |       108 
        55 |        54          0 |        54 
        56 |        54         54 |       108 
        57 |        54         54 |       108 
        58 |        54         54 |       108 
        59 |        54         54 |       108 
        60 |        54         54 |       108 
        61 |        54         54 |       108 
        62 |        54         54 |       108 
        63 |        54         54 |       108 
        64 |        54         54 |       108 
        65 |        54         54 |       108 
        66 |        54         54 |       108 
        67 |        54         54 |       108 
        68 |        54         54 |       108 
        69 |        54         54 |       108 
        70 |        54         54 |       108 
        71 |        54         54 |       108 
        72 |        54         54 |       108 
        73 |        54         54 |       108 
        74 |        54         54 |       108 
        75 |        54         54 |       108 
        76 |        54         54 |       108 
        77 |        54         54 |       108 
        78 |        54         54 |       108 
        79 |        54         54 |       108 
        80 |        54         54 |       108 
        81 |        54         54 |       108 
        82 |        54         54 |       108 
        83 |        54         54 |       108 
        84 |        54         54 |       108 
        85 |        54         54 |       108 
        86 |        54         54 |       108 
        87 |        54         54 |       108 
        88 |        54         54 |       108 
        89 |        54         54 |       108 
        90 |        54          0 |        54 
        91 |        54         54 |       108 
        92 |        54         54 |       108 
        93 |        54         54 |       108 
        94 |        54         54 |       108 
        95 |        54         54 |       108 
        96 |        54         54 |       108 
        97 |        54         54 |       108 
        98 |        54         54 |       108 
        99 |        54         54 |       108 
       100 |        54         54 |       108 
       101 |        54         54 |       108 
       102 |        54         54 |       108 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. 
. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646      3,726 |     6,372 
         1 |     2,862      1,674 |     4,536 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. 
. * merge
. sort dnh_data SID

. if "$doDirectory" == "y" {
.         merge m:1 dnh_data SID using "$data/ALL_rocl_violations_count.dta"
. }

. else {
.         merge m:1 dnh_data SID using ALL_rocl_violations_count

    Result                      Number of obs
    -----------------------------------------
    Not matched                           550
        from master                         0  (_merge==1)
        from using                        550  (_merge==2)

    Matched                            10,908  (_merge==3)
    -----------------------------------------
. }

. keep if _merge == 3
(550 observations deleted)

. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646      3,726 |     6,372 
         1 |     2,862      1,674 |     4,536 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. 
. summ rocl_subj_viol if risk==1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_subj_~l |          0

. summ rocl_subj_viol if risk==1 & dnh_data==0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_subj_~l |          0

. summ rocl_subj_viol if risk==1 & dnh_data==1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_subj_~l |          0

. 
. des rocl*, fullnames

Variable      Storage   Display    Value
    name         type    format    label      Variable label
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rocl_ae         byte    %8.0g                 One option is simple and the other is the actuarially-equivalent simple lottery
rocl_don        byte    %8.0g                 One option is simple and one is compound (Double Or Nothing)
rocl_aedon      byte    %8.0g                 One option is the actuarially-equivalent simple lottery and the other is the com
rocl            byte    %8.0g                 A compound lottery is involved
rocl_choice1    int     %8.0g                 
rocl_choice2    int     %8.0g                 
rocl_choice3    int     %8.0g                 
rocl_choice4    int     %8.0g                 
rocl_choice5    int     %8.0g                 
rocl_choice6    int     %8.0g                 
rocl_choice7    int     %8.0g                 
rocl_choice8    int     %8.0g                 
rocl_choice9    int     %8.0g                 
rocl_choice10   int     %8.0g                 
rocl_choice11   int     %8.0g                 
rocl_choice12   int     %8.0g                 
rocl_choice13   int     %8.0g                 
rocl_choice14   int     %8.0g                 
rocl_choice15   int     %8.0g                 
rocl_viol_CRloving
                byte    %9.0g                 ROCL Violation Count - Compound Risk Loving
rocl_viol_CRaversion
                byte    %9.0g                 ROCL Violation Count - Compound Risk Aversion
rocl_viol_CRloving_2
                byte    %9.0g                 ROCL Violation Count - Compound Risk Loving, squared
rocl_viol_CRaversion_2
                byte    %9.0g                 ROCL Violation Count - Compound Risk Aversion, squared
rocl_subj_viol  byte    %9.0g                 ROCL Violation Count
rocl_subj_viol2 byte    %9.0g                 ROCL Violation Count, squared

. tab rocl_subj_viol dnh_data

      ROCL |     Data from DNH
 Violation |  experiments in 2019
     Count |         0          1 |     Total
-----------+----------------------+----------
         0 |        54        162 |       216 
         1 |       432        486 |       918 
         2 |       756        810 |     1,566 
         3 |     1,188        972 |     2,160 
         4 |     1,512        918 |     2,430 
         5 |       486        756 |     1,242 
         6 |       594        756 |     1,350 
         7 |       324        378 |       702 
         8 |       162        162 |       324 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab rocl_subj_viol dnh_data if record == 1

      ROCL |     Data from DNH
 Violation |  experiments in 2019
     Count |         0          1 |     Total
-----------+----------------------+----------
         0 |         0          3 |         3 
         1 |         3          9 |        12 
         2 |         3         15 |        18 
         3 |         8         18 |        26 
         4 |        14         17 |        31 
         5 |         4         14 |        18 
         6 |         6         14 |        20 
         7 |         1          7 |         8 
         8 |         3          3 |         6 
-----------+----------------------+----------
     Total |        42        100 |       142 

. 
. * regenerate the record variable, and check -- now we have all 102 OLD and all 650 DNH
. bysort dnh_data SID: egen int record_new = seq()

. tab rocl_subj_viol dnh_data if record_new == 1

      ROCL |     Data from DNH
 Violation |  experiments in 2019
     Count |         0          1 |     Total
-----------+----------------------+----------
         0 |         1          3 |         4 
         1 |         8          9 |        17 
         2 |        14         15 |        29 
         3 |        22         18 |        40 
         4 |        28         17 |        45 
         5 |         9         14 |        23 
         6 |        11         14 |        25 
         7 |         6          7 |        13 
         8 |         3          3 |         6 
-----------+----------------------+----------
     Total |       102        100 |       202 

. 
. * replace old record
. drop record

. rename record_new record

. 
. * check the N
. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646      3,726 |     6,372 
         1 |     2,862      1,674 |     4,536 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. 
. * text
. tab ae dnh_data if record==1, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        53         31 |        84 
         1 |        49         69 |       118 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ii dnh_data if record==1, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        49         69 |       118 
         1 |        53         31 |        84 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ae ii if record==1, missing

     Index |
  isurance |
actuariall |    Index insurance
y-equivale |   compound lottery
nt lottery |         frame
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |         0         84 |        84 
         1 |       118          0 |       118 
-----------+----------------------+----------
     Total |       118         84 |       202 

. 
. ////////////////////////////////////////////////////////////////////////////////
> ///////////////////////Create variables/////////////////////////////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. *Change eff_reg_EUT to be between 0 and 1
. tab eff_reg_EUT

eff_reg_EUT |      Freq.     Percent        Cum.
------------+-----------------------------------
   .0227222 |        162        1.49        1.49
   .0330656 |         54        0.50        1.99
   .0478785 |         54        0.50        2.49
   .0512137 |         54        0.50        2.99
   .0620343 |         54        0.50        3.48
   .0628485 |         54        0.50        3.98
   .0718811 |         54        0.50        4.48
   .0773822 |         54        0.50        4.98
   .0887434 |         54        0.50        5.47
   .0925946 |         54        0.50        5.97
   .0956481 |         54        0.50        6.47
   .0987016 |         54        0.50        6.97
   .1030256 |         54        0.50        7.46
    .113316 |         54        0.50        7.96
   .1135013 |         54        0.50        8.46
   .1210937 |         54        0.50        8.96
   .1229788 |         54        0.50        9.45
   .1279211 |         54        0.50        9.95
   .1280074 |         54        0.50       10.45
   .1384518 |         54        0.50       10.95
   .1574232 |         54        0.50       11.44
   .1610284 |         54        0.50       11.94
   .1651353 |         54        0.50       12.44
     .17966 |         54        0.50       12.94
   .1810789 |         54        0.50       13.43
   .1819707 |         54        0.50       13.93
   .1877476 |         54        0.50       14.43
   .1895584 |         54        0.50       14.93
   .1909722 |         54        0.50       15.42
   .1926087 |         54        0.50       15.92
   .1926717 |         54        0.50       16.42
   .1979333 |         54        0.50       16.92
   .2126683 |         54        0.50       17.41
    .215559 |         54        0.50       17.91
   .2234265 |         54        0.50       18.41
   .2236435 |         54        0.50       18.91
   .2304687 |         54        0.50       19.40
   .2330255 |         54        0.50       19.90
   .2379562 |         54        0.50       20.40
     .24227 |         54        0.50       20.90
   .2431228 |         54        0.50       21.39
   .2463627 |         54        0.50       21.89
   .2482669 |         54        0.50       22.39
    .248487 |         54        0.50       22.89
   .2526002 |         54        0.50       23.38
   .2545664 |         54        0.50       23.88
   .2561432 |         54        0.50       24.38
   .2633324 |         54        0.50       24.88
   .2636719 |         54        0.50       25.37
   .2658216 |         54        0.50       25.87
   .2662687 |         54        0.50       26.37
   .2688575 |         54        0.50       26.87
   .2760733 |         54        0.50       27.36
   .2803972 |         54        0.50       27.86
   .2826191 |         54        0.50       28.36
   .2830503 |         54        0.50       28.86
   .2917765 |         54        0.50       29.35
   .2965712 |         54        0.50       29.85
   .2974968 |         54        0.50       30.35
   .2977563 |         54        0.50       30.85
    .297969 |         54        0.50       31.34
   .2982899 |         54        0.50       31.84
    .298443 |         54        0.50       32.34
   .2988831 |         54        0.50       32.84
   .3006292 |         54        0.50       33.33
    .301414 |         54        0.50       33.83
   .3054181 |         54        0.50       34.33
   .3058779 |         54        0.50       34.83
   .3065131 |         54        0.50       35.32
   .3113721 |         54        0.50       35.82
   .3152509 |         54        0.50       36.32
   .3189095 |         54        0.50       36.82
   .3207144 |         54        0.50       37.31
   .3233109 |         54        0.50       37.81
    .332994 |         54        0.50       38.31
    .337698 |         54        0.50       38.81
   .3382603 |         54        0.50       39.30
    .340175 |         54        0.50       39.80
   .3502004 |         54        0.50       40.30
   .3522502 |         54        0.50       40.80
   .3629811 |         54        0.50       41.29
   .3680128 |         54        0.50       41.79
   .3693607 |         54        0.50       42.29
   .3744498 |         54        0.50       42.79
   .3750275 |         54        0.50       43.28
   .3775325 |         54        0.50       43.78
   .3782427 |         54        0.50       44.28
   .3816187 |         54        0.50       44.78
    .381672 |         54        0.50       45.27
   .3903774 |         54        0.50       45.77
   .3904977 |         54        0.50       46.27
    .390625 |         54        0.50       46.77
   .3961267 |         54        0.50       47.26
   .3964658 |         54        0.50       47.76
    .398575 |         54        0.50       48.26
   .4009683 |         54        0.50       48.76
   .4061592 |         54        0.50       49.25
   .4091284 |         54        0.50       49.75
   .4098536 |         54        0.50       50.25
   .4101838 |         54        0.50       50.75
   .4111741 |         54        0.50       51.24
   .4118068 |         54        0.50       51.74
   .4136654 |         54        0.50       52.24
   .4207999 |         54        0.50       52.74
   .4238556 |         54        0.50       53.23
   .4295311 |         54        0.50       53.73
   .4323283 |         54        0.50       54.23
   .4345947 |         54        0.50       54.73
   .4456151 |         54        0.50       55.22
   .4482284 |         54        0.50       55.72
   .4558759 |         54        0.50       56.22
   .4586867 |         54        0.50       56.72
   .4600022 |         54        0.50       57.21
   .4605799 |         54        0.50       57.71
   .4653664 |         54        0.50       58.21
   .4658616 |         54        0.50       58.71
   .4668244 |         54        0.50       59.20
   .4680348 |         54        0.50       59.70
   .4691076 |         54        0.50       60.20
   .4692727 |         54        0.50       60.70
   .4737144 |         54        0.50       61.19
   .4739619 |         54        0.50       61.69
   .4785474 |         54        0.50       62.19
   .4822293 |         54        0.50       62.69
   .4876879 |         54        0.50       63.18
   .4935079 |         54        0.50       63.68
   .4972712 |         54        0.50       64.18
   .4978849 |         54        0.50       64.68
   .5028059 |         54        0.50       65.17
   .5031507 |         54        0.50       65.67
   .5034805 |         54        0.50       66.17
   .5042639 |         54        0.50       66.67
   .5085552 |         54        0.50       67.16
   .5097381 |         54        0.50       67.66
   .5104442 |         54        0.50       68.16
   .5119938 |         54        0.50       68.66
   .5209617 |         54        0.50       69.15
   .5227197 |         54        0.50       69.65
   .5231899 |         54        0.50       70.15
   .5235543 |         54        0.50       70.65
   .5237565 |         54        0.50       71.14
    .529115 |         54        0.50       71.64
   .5379897 |         54        0.50       72.14
      .5463 |         54        0.50       72.64
   .5473701 |         54        0.50       73.13
   .5502861 |         54        0.50       73.63
   .5511282 |         54        0.50       74.13
    .551689 |         54        0.50       74.63
   .5555221 |         54        0.50       75.12
   .5595671 |         54        0.50       75.62
    .562892 |         54        0.50       76.12
   .5744388 |         54        0.50       76.62
   .5770058 |         54        0.50       77.11
    .577287 |         54        0.50       77.61
   .5793629 |         54        0.50       78.11
   .5809034 |         54        0.50       78.61
   .5890043 |         54        0.50       79.10
   .5958132 |         54        0.50       79.60
   .6003901 |         54        0.50       80.10
   .6022866 |         54        0.50       80.60
   .6027659 |         54        0.50       81.09
   .6083399 |         54        0.50       81.59
   .6287962 |         54        0.50       82.09
   .6320836 |         54        0.50       82.59
   .6340229 |         54        0.50       83.08
   .6409642 |         54        0.50       83.58
   .6446421 |         54        0.50       84.08
   .6462368 |         54        0.50       84.58
   .6531069 |         54        0.50       85.07
   .6536565 |         54        0.50       85.57
   .6542969 |         54        0.50       86.07
   .6551921 |         54        0.50       86.57
   .6596611 |         54        0.50       87.06
   .6806645 |         54        0.50       87.56
   .6829544 |         54        0.50       88.06
   .6940471 |         54        0.50       88.56
   .6968095 |         54        0.50       89.05
   .7068937 |         54        0.50       89.55
   .7106349 |         54        0.50       90.05
   .7118846 |         54        0.50       90.55
   .7151464 |         54        0.50       91.04
   .7162467 |         54        0.50       91.54
   .7194685 |         54        0.50       92.04
    .720542 |         54        0.50       92.54
   .7309914 |         54        0.50       93.03
    .746809 |         54        0.50       93.53
   .7469741 |         54        0.50       94.03
   .7482945 |         54        0.50       94.53
   .7490494 |         54        0.50       95.02
   .7697238 |         54        0.50       95.52
   .8051276 |         54        0.50       96.02
   .8374321 |         54        0.50       96.52
   .8415218 |         54        0.50       97.01
   .9134023 |         54        0.50       97.51
    .924583 |         54        0.50       98.01
   .9377476 |         54        0.50       98.51
    .974857 |         54        0.50       99.00
   .9759848 |         54        0.50       99.50
   .9772778 |         54        0.50      100.00
------------+-----------------------------------
      Total |     10,854      100.00

. recode eff_reg_EUT (0=0.0001)
(0 changes made to eff_reg_EUT)

. recode eff_reg_EUT (1=0.9999)
(0 changes made to eff_reg_EUT)

. tab eff_reg_EUT

eff_reg_EUT |      Freq.     Percent        Cum.
------------+-----------------------------------
   .0227222 |        162        1.49        1.49
   .0330656 |         54        0.50        1.99
   .0478785 |         54        0.50        2.49
   .0512137 |         54        0.50        2.99
   .0620343 |         54        0.50        3.48
   .0628485 |         54        0.50        3.98
   .0718811 |         54        0.50        4.48
   .0773822 |         54        0.50        4.98
   .0887434 |         54        0.50        5.47
   .0925946 |         54        0.50        5.97
   .0956481 |         54        0.50        6.47
   .0987016 |         54        0.50        6.97
   .1030256 |         54        0.50        7.46
    .113316 |         54        0.50        7.96
   .1135013 |         54        0.50        8.46
   .1210937 |         54        0.50        8.96
   .1229788 |         54        0.50        9.45
   .1279211 |         54        0.50        9.95
   .1280074 |         54        0.50       10.45
   .1384518 |         54        0.50       10.95
   .1574232 |         54        0.50       11.44
   .1610284 |         54        0.50       11.94
   .1651353 |         54        0.50       12.44
     .17966 |         54        0.50       12.94
   .1810789 |         54        0.50       13.43
   .1819707 |         54        0.50       13.93
   .1877476 |         54        0.50       14.43
   .1895584 |         54        0.50       14.93
   .1909722 |         54        0.50       15.42
   .1926087 |         54        0.50       15.92
   .1926717 |         54        0.50       16.42
   .1979333 |         54        0.50       16.92
   .2126683 |         54        0.50       17.41
    .215559 |         54        0.50       17.91
   .2234265 |         54        0.50       18.41
   .2236435 |         54        0.50       18.91
   .2304687 |         54        0.50       19.40
   .2330255 |         54        0.50       19.90
   .2379562 |         54        0.50       20.40
     .24227 |         54        0.50       20.90
   .2431228 |         54        0.50       21.39
   .2463627 |         54        0.50       21.89
   .2482669 |         54        0.50       22.39
    .248487 |         54        0.50       22.89
   .2526002 |         54        0.50       23.38
   .2545664 |         54        0.50       23.88
   .2561432 |         54        0.50       24.38
   .2633324 |         54        0.50       24.88
   .2636719 |         54        0.50       25.37
   .2658216 |         54        0.50       25.87
   .2662687 |         54        0.50       26.37
   .2688575 |         54        0.50       26.87
   .2760733 |         54        0.50       27.36
   .2803972 |         54        0.50       27.86
   .2826191 |         54        0.50       28.36
   .2830503 |         54        0.50       28.86
   .2917765 |         54        0.50       29.35
   .2965712 |         54        0.50       29.85
   .2974968 |         54        0.50       30.35
   .2977563 |         54        0.50       30.85
    .297969 |         54        0.50       31.34
   .2982899 |         54        0.50       31.84
    .298443 |         54        0.50       32.34
   .2988831 |         54        0.50       32.84
   .3006292 |         54        0.50       33.33
    .301414 |         54        0.50       33.83
   .3054181 |         54        0.50       34.33
   .3058779 |         54        0.50       34.83
   .3065131 |         54        0.50       35.32
   .3113721 |         54        0.50       35.82
   .3152509 |         54        0.50       36.32
   .3189095 |         54        0.50       36.82
   .3207144 |         54        0.50       37.31
   .3233109 |         54        0.50       37.81
    .332994 |         54        0.50       38.31
    .337698 |         54        0.50       38.81
   .3382603 |         54        0.50       39.30
    .340175 |         54        0.50       39.80
   .3502004 |         54        0.50       40.30
   .3522502 |         54        0.50       40.80
   .3629811 |         54        0.50       41.29
   .3680128 |         54        0.50       41.79
   .3693607 |         54        0.50       42.29
   .3744498 |         54        0.50       42.79
   .3750275 |         54        0.50       43.28
   .3775325 |         54        0.50       43.78
   .3782427 |         54        0.50       44.28
   .3816187 |         54        0.50       44.78
    .381672 |         54        0.50       45.27
   .3903774 |         54        0.50       45.77
   .3904977 |         54        0.50       46.27
    .390625 |         54        0.50       46.77
   .3961267 |         54        0.50       47.26
   .3964658 |         54        0.50       47.76
    .398575 |         54        0.50       48.26
   .4009683 |         54        0.50       48.76
   .4061592 |         54        0.50       49.25
   .4091284 |         54        0.50       49.75
   .4098536 |         54        0.50       50.25
   .4101838 |         54        0.50       50.75
   .4111741 |         54        0.50       51.24
   .4118068 |         54        0.50       51.74
   .4136654 |         54        0.50       52.24
   .4207999 |         54        0.50       52.74
   .4238556 |         54        0.50       53.23
   .4295311 |         54        0.50       53.73
   .4323283 |         54        0.50       54.23
   .4345947 |         54        0.50       54.73
   .4456151 |         54        0.50       55.22
   .4482284 |         54        0.50       55.72
   .4558759 |         54        0.50       56.22
   .4586867 |         54        0.50       56.72
   .4600022 |         54        0.50       57.21
   .4605799 |         54        0.50       57.71
   .4653664 |         54        0.50       58.21
   .4658616 |         54        0.50       58.71
   .4668244 |         54        0.50       59.20
   .4680348 |         54        0.50       59.70
   .4691076 |         54        0.50       60.20
   .4692727 |         54        0.50       60.70
   .4737144 |         54        0.50       61.19
   .4739619 |         54        0.50       61.69
   .4785474 |         54        0.50       62.19
   .4822293 |         54        0.50       62.69
   .4876879 |         54        0.50       63.18
   .4935079 |         54        0.50       63.68
   .4972712 |         54        0.50       64.18
   .4978849 |         54        0.50       64.68
   .5028059 |         54        0.50       65.17
   .5031507 |         54        0.50       65.67
   .5034805 |         54        0.50       66.17
   .5042639 |         54        0.50       66.67
   .5085552 |         54        0.50       67.16
   .5097381 |         54        0.50       67.66
   .5104442 |         54        0.50       68.16
   .5119938 |         54        0.50       68.66
   .5209617 |         54        0.50       69.15
   .5227197 |         54        0.50       69.65
   .5231899 |         54        0.50       70.15
   .5235543 |         54        0.50       70.65
   .5237565 |         54        0.50       71.14
    .529115 |         54        0.50       71.64
   .5379897 |         54        0.50       72.14
      .5463 |         54        0.50       72.64
   .5473701 |         54        0.50       73.13
   .5502861 |         54        0.50       73.63
   .5511282 |         54        0.50       74.13
    .551689 |         54        0.50       74.63
   .5555221 |         54        0.50       75.12
   .5595671 |         54        0.50       75.62
    .562892 |         54        0.50       76.12
   .5744388 |         54        0.50       76.62
   .5770058 |         54        0.50       77.11
    .577287 |         54        0.50       77.61
   .5793629 |         54        0.50       78.11
   .5809034 |         54        0.50       78.61
   .5890043 |         54        0.50       79.10
   .5958132 |         54        0.50       79.60
   .6003901 |         54        0.50       80.10
   .6022866 |         54        0.50       80.60
   .6027659 |         54        0.50       81.09
   .6083399 |         54        0.50       81.59
   .6287962 |         54        0.50       82.09
   .6320836 |         54        0.50       82.59
   .6340229 |         54        0.50       83.08
   .6409642 |         54        0.50       83.58
   .6446421 |         54        0.50       84.08
   .6462368 |         54        0.50       84.58
   .6531069 |         54        0.50       85.07
   .6536565 |         54        0.50       85.57
   .6542969 |         54        0.50       86.07
   .6551921 |         54        0.50       86.57
   .6596611 |         54        0.50       87.06
   .6806645 |         54        0.50       87.56
   .6829544 |         54        0.50       88.06
   .6940471 |         54        0.50       88.56
   .6968095 |         54        0.50       89.05
   .7068937 |         54        0.50       89.55
   .7106349 |         54        0.50       90.05
   .7118846 |         54        0.50       90.55
   .7151464 |         54        0.50       91.04
   .7162467 |         54        0.50       91.54
   .7194685 |         54        0.50       92.04
    .720542 |         54        0.50       92.54
   .7309914 |         54        0.50       93.03
    .746809 |         54        0.50       93.53
   .7469741 |         54        0.50       94.03
   .7482945 |         54        0.50       94.53
   .7490494 |         54        0.50       95.02
   .7697238 |         54        0.50       95.52
   .8051276 |         54        0.50       96.02
   .8374321 |         54        0.50       96.52
   .8415218 |         54        0.50       97.01
   .9134023 |         54        0.50       97.51
    .924583 |         54        0.50       98.01
   .9377476 |         54        0.50       98.51
    .974857 |         54        0.50       99.00
   .9759848 |         54        0.50       99.50
   .9772778 |         54        0.50      100.00
------------+-----------------------------------
      Total |     10,854      100.00

. 
. *Change eff_reg_sdEUT to be between 0 and 1
. recode eff_reg_sdEUT (0=0.0001)
(0 changes made to eff_reg_sdEUT)

. recode eff_reg_sdEUT (1=0.9999)
(0 changes made to eff_reg_sdEUT)

. tab eff_reg_sdEUT

eff_reg_sdE |
         UT |      Freq.     Percent        Cum.
------------+-----------------------------------
   .0166017 |         54        0.51        0.51
   .0166285 |         54        0.51        1.02
   .0250746 |         54        0.51        1.52
    .040379 |         54        0.51        2.03
   .0542891 |         54        0.51        2.54
   .0564864 |         54        0.51        3.05
   .0588377 |         54        0.51        3.55
   .0707313 |         54        0.51        4.06
   .0746944 |         54        0.51        4.57
   .0940584 |         54        0.51        5.08
   .0990809 |         54        0.51        5.58
   .1029744 |         54        0.51        6.09
   .1126276 |         54        0.51        6.60
   .1149153 |         54        0.51        7.11
   .1217056 |         54        0.51        7.61
   .1238924 |         54        0.51        8.12
   .1282672 |         54        0.51        8.63
   .1296698 |         54        0.51        9.14
   .1341192 |         54        0.51        9.64
   .1573574 |         54        0.51       10.15
   .1609217 |         54        0.51       10.66
   .1671341 |         54        0.51       11.17
   .1758362 |         54        0.51       11.68
   .1797313 |         54        0.51       12.18
   .1838209 |         54        0.51       12.69
   .1906355 |         54        0.51       13.20
   .1928383 |         54        0.51       13.71
   .1942197 |         54        0.51       14.21
   .1980712 |         54        0.51       14.72
   .2013701 |         54        0.51       15.23
   .2016134 |         54        0.51       15.74
   .2044484 |         54        0.51       16.24
    .212702 |         54        0.51       16.75
   .2155557 |         54        0.51       17.26
   .2183951 |         54        0.51       17.77
   .2234924 |         54        0.51       18.27
   .2252297 |         54        0.51       18.78
   .2332645 |         54        0.51       19.29
   .2376852 |         54        0.51       19.80
   .2378754 |         54        0.51       20.30
   .2466047 |         54        0.51       20.81
   .2502363 |         54        0.51       21.32
   .2529324 |         54        0.51       21.83
   .2545445 |         54        0.51       22.34
    .256387 |         54        0.51       22.84
   .2639623 |         54        0.51       23.35
    .264002 |         54        0.51       23.86
    .267456 |         54        0.51       24.37
   .2693062 |         54        0.51       24.87
     .27014 |         54        0.51       25.38
   .2785704 |         54        0.51       25.89
   .2797372 |         54        0.51       26.40
    .282908 |         54        0.51       26.90
   .2841175 |         54        0.51       27.41
   .2884878 |         54        0.51       27.92
   .2895983 |         54        0.51       28.43
   .2916953 |         54        0.51       28.93
   .2945223 |         54        0.51       29.44
   .2966479 |         54        0.51       29.95
   .2968745 |         54        0.51       30.46
   .2969661 |         54        0.51       30.96
   .2980982 |         54        0.51       31.47
   .2990475 |         54        0.51       31.98
   .2990769 |         54        0.51       32.49
     .29953 |         54        0.51       32.99
   .3012581 |         54        0.51       33.50
   .3031656 |         54        0.51       34.01
   .3155963 |         54        0.51       34.52
   .3161144 |         54        0.51       35.03
   .3240048 |         54        0.51       35.53
   .3278106 |         54        0.51       36.04
   .3349774 |         54        0.51       36.55
   .3370696 |         54        0.51       37.06
   .3398137 |         54        0.51       37.56
   .3400919 |         54        0.51       38.07
   .3501651 |         54        0.51       38.58
    .363006 |         54        0.51       39.09
   .3663711 |         54        0.51       39.59
   .3746534 |         54        0.51       40.10
   .3754066 |         54        0.51       40.61
   .3768759 |         54        0.51       41.12
   .3775986 |         54        0.51       41.62
   .3804365 |         54        0.51       42.13
   .3811333 |         54        0.51       42.64
   .3815818 |         54        0.51       43.15
    .383363 |         54        0.51       43.65
   .3905639 |         54        0.51       44.16
   .3906408 |         54        0.51       44.67
    .394065 |         54        0.51       45.18
   .3963658 |         54        0.51       45.69
     .40296 |         54        0.51       46.19
   .4041076 |         54        0.51       46.70
   .4074441 |         54        0.51       47.21
   .4099546 |         54        0.51       47.72
   .4102103 |         54        0.51       48.22
   .4206963 |         54        0.51       48.73
   .4207455 |         54        0.51       49.24
   .4240892 |         54        0.51       49.75
   .4249393 |         54        0.51       50.25
   .4292679 |         54        0.51       50.76
    .434057 |         54        0.51       51.27
   .4346707 |         54        0.51       51.78
   .4393467 |         54        0.51       52.28
   .4396764 |         54        0.51       52.79
   .4437239 |         54        0.51       53.30
   .4441306 |         54        0.51       53.81
   .4484786 |         54        0.51       54.31
   .4485671 |         54        0.51       54.82
   .4509149 |         54        0.51       55.33
   .4518375 |         54        0.51       55.84
   .4557128 |         54        0.51       56.35
   .4606506 |         54        0.51       56.85
   .4679615 |         54        0.51       57.36
    .468836 |         54        0.51       57.87
   .4691256 |         54        0.51       58.38
   .4698036 |         54        0.51       58.88
   .4749016 |         54        0.51       59.39
   .4776481 |         54        0.51       59.90
   .4823028 |         54        0.51       60.41
   .4881005 |         54        0.51       60.91
   .4928664 |         54        0.51       61.42
   .4947576 |         54        0.51       61.93
   .4952956 |         54        0.51       62.44
    .497144 |         54        0.51       62.94
   .4989372 |         54        0.51       63.45
   .5017219 |         54        0.51       63.96
   .5021299 |         54        0.51       64.47
   .5028104 |         54        0.51       64.97
   .5031747 |         54        0.51       65.48
   .5088605 |         54        0.51       65.99
   .5090749 |         54        0.51       66.50
   .5111274 |         54        0.51       67.01
   .5122847 |         54        0.51       67.51
   .5169993 |         54        0.51       68.02
   .5197453 |         54        0.51       68.53
   .5209875 |         54        0.51       69.04
   .5235186 |         54        0.51       69.54
   .5236136 |         54        0.51       70.05
   .5249474 |         54        0.51       70.56
   .5469946 |         54        0.51       71.07
    .549859 |         54        0.51       71.57
   .5499827 |         54        0.51       72.08
     .55163 |         54        0.51       72.59
   .5555413 |         54        0.51       73.10
   .5605744 |         54        0.51       73.60
   .5629249 |         54        0.51       74.11
   .5715514 |         54        0.51       74.62
   .5720221 |         54        0.51       75.13
   .5772193 |         54        0.51       75.63
   .5783944 |         54        0.51       76.14
   .5803373 |         54        0.51       76.65
   .5898062 |         54        0.51       77.16
   .5930054 |         54        0.51       77.66
   .5958039 |         54        0.51       78.17
   .5963603 |         54        0.51       78.68
   .6001471 |         54        0.51       79.19
   .6001674 |         54        0.51       79.70
   .6016047 |         54        0.51       80.20
   .6085312 |         54        0.51       80.71
    .608825 |         54        0.51       81.22
   .6279915 |         54        0.51       81.73
   .6320076 |         54        0.51       82.23
   .6324567 |         54        0.51       82.74
   .6335372 |         54        0.51       83.25
   .6407225 |         54        0.51       83.76
    .644381 |         54        0.51       84.26
   .6445985 |         54        0.51       84.77
   .6512524 |         54        0.51       85.28
   .6527759 |         54        0.51       85.79
   .6535523 |         54        0.51       86.29
   .6578184 |         54        0.51       86.80
   .6655816 |         54        0.51       87.31
   .6698147 |         54        0.51       87.82
   .6792639 |         54        0.51       88.32
   .6805688 |         54        0.51       88.83
    .686396 |         54        0.51       89.34
   .6975446 |         54        0.51       89.85
   .7122045 |         54        0.51       90.36
   .7145116 |         54        0.51       90.86
   .7147778 |         54        0.51       91.37
   .7169848 |         54        0.51       91.88
    .720975 |         54        0.51       92.39
   .7214631 |         54        0.51       92.89
   .7313931 |         54        0.51       93.40
   .7397148 |         54        0.51       93.91
   .7399091 |         54        0.51       94.42
   .7436219 |         54        0.51       94.92
   .7458991 |         54        0.51       95.43
   .7511903 |         54        0.51       95.94
   .8095834 |         54        0.51       96.45
   .8428183 |         54        0.51       96.95
   .9157892 |         54        0.51       97.46
   .9253049 |         54        0.51       97.97
   .9422119 |         54        0.51       98.48
   .9681308 |         54        0.51       98.98
   .9699625 |         54        0.51       99.49
   .9710417 |         54        0.51      100.00
------------+-----------------------------------
      Total |     10,638      100.00

. 
. *Change eff_reg_RDU to be between 0 and 1
. recode eff_reg_RDU (0=0.0001)
(54 changes made to eff_reg_RDU)

. recode eff_reg_RDU (1=0.9999)
(0 changes made to eff_reg_RDU)

. tab eff_reg_RDU

eff_reg_RDU |      Freq.     Percent        Cum.
------------+-----------------------------------
      .0001 |         54        0.53        0.53
    .016744 |         54        0.53        1.05
   .0618333 |         54        0.53        1.58
   .0884103 |         54        0.53        2.11
   .0998307 |         54        0.53        2.63
   .1029469 |         54        0.53        3.16
   .1150363 |         54        0.53        3.68
   .1194239 |         54        0.53        4.21
   .1303687 |         54        0.53        4.74
   .1398842 |         54        0.53        5.26
   .1463881 |         54        0.53        5.79
   .1576921 |         54        0.53        6.32
   .1775056 |         54        0.53        6.84
    .196051 |         54        0.53        7.37
   .2030376 |         54        0.53        7.89
    .204717 |         54        0.53        8.42
   .2056018 |         54        0.53        8.95
   .2085367 |         54        0.53        9.47
   .2237711 |         54        0.53       10.00
   .2240099 |         54        0.53       10.53
   .2386364 |         54        0.53       11.05
   .2398013 |         54        0.53       11.58
    .243149 |         54        0.53       12.11
     .25624 |         54        0.53       12.63
   .2694613 |         54        0.53       13.16
   .2697294 |         54        0.53       13.68
   .2754993 |         54        0.53       14.21
    .277601 |         54        0.53       14.74
   .2814792 |         54        0.53       15.26
   .2826377 |         54        0.53       15.79
   .2892364 |         54        0.53       16.32
   .2903532 |         54        0.53       16.84
   .2912057 |         54        0.53       17.37
   .2939256 |         54        0.53       17.89
   .2951669 |         54        0.53       18.42
   .2977544 |         54        0.53       18.95
   .3040726 |         54        0.53       19.47
   .3144668 |         54        0.53       20.00
   .3187492 |         54        0.53       20.53
   .3191925 |         54        0.53       21.05
   .3241647 |         54        0.53       21.58
   .3277684 |         54        0.53       22.11
   .3328312 |         54        0.53       22.63
   .3335463 |         54        0.53       23.16
   .3346071 |         54        0.53       23.68
   .3350824 |         54        0.53       24.21
   .3404882 |         54        0.53       24.74
   .3462537 |         54        0.53       25.26
   .3492937 |         54        0.53       25.79
   .3556634 |         54        0.53       26.32
    .355689 |         54        0.53       26.84
   .3568985 |         54        0.53       27.37
   .3648108 |         54        0.53       27.89
   .3749425 |         54        0.53       28.42
   .3753535 |         54        0.53       28.95
   .3773041 |         54        0.53       29.47
   .3787936 |         54        0.53       30.00
   .3806034 |         54        0.53       30.53
   .3884466 |         54        0.53       31.05
   .3898838 |         54        0.53       31.58
   .3944427 |         54        0.53       32.11
   .3949507 |         54        0.53       32.63
   .3979664 |         54        0.53       33.16
   .4009849 |         54        0.53       33.68
   .4040882 |         54        0.53       34.21
   .4052663 |         54        0.53       34.74
    .406726 |         54        0.53       35.26
   .4108668 |         54        0.53       35.79
   .4116544 |         54        0.53       36.32
    .413805 |         54        0.53       36.84
   .4154267 |         54        0.53       37.37
   .4172875 |         54        0.53       37.89
   .4174019 |         54        0.53       38.42
   .4207754 |         54        0.53       38.95
   .4231473 |         54        0.53       39.47
   .4296528 |         54        0.53       40.00
   .4296971 |         54        0.53       40.53
    .429736 |         54        0.53       41.05
   .4324055 |         54        0.53       41.58
   .4407014 |         54        0.53       42.11
   .4472716 |         54        0.53       42.63
   .4501476 |         54        0.53       43.16
   .4523075 |         54        0.53       43.68
   .4538075 |         54        0.53       44.21
    .456512 |         54        0.53       44.74
   .4565572 |         54        0.53       45.26
   .4567084 |         54        0.53       45.79
   .4591898 |         54        0.53       46.32
   .4617572 |         54        0.53       46.84
   .4622701 |         54        0.53       47.37
   .4714599 |         54        0.53       47.89
   .4822515 |         54        0.53       48.42
    .484367 |         54        0.53       48.95
    .484621 |         54        0.53       49.47
   .4902354 |         54        0.53       50.00
   .4902589 |         54        0.53       50.53
   .4923909 |         54        0.53       51.05
   .4926512 |         54        0.53       51.58
   .4929052 |         54        0.53       52.11
   .4929627 |         54        0.53       52.63
   .4977081 |         54        0.53       53.16
   .5018948 |         54        0.53       53.68
   .5040027 |         54        0.53       54.21
   .5040299 |         54        0.53       54.74
   .5062153 |         54        0.53       55.26
   .5069316 |         54        0.53       55.79
   .5137857 |         54        0.53       56.32
   .5158361 |         54        0.53       56.84
   .5163575 |         54        0.53       57.37
   .5166629 |         54        0.53       57.89
   .5191696 |         54        0.53       58.42
   .5248735 |         54        0.53       58.95
   .5258627 |         54        0.53       59.47
   .5292437 |         54        0.53       60.00
    .530677 |         54        0.53       60.53
   .5310988 |         54        0.53       61.05
   .5335923 |         54        0.53       61.58
   .5343448 |         54        0.53       62.11
   .5375087 |         54        0.53       62.63
   .5400779 |         54        0.53       63.16
   .5407924 |         54        0.53       63.68
    .543147 |         54        0.53       64.21
   .5434808 |         54        0.53       64.74
   .5437192 |         54        0.53       65.26
   .5441675 |         54        0.53       65.79
   .5457187 |         54        0.53       66.32
   .5467828 |         54        0.53       66.84
   .5499302 |         54        0.53       67.37
   .5545843 |         54        0.53       67.89
   .5555029 |         54        0.53       68.42
   .5583784 |         54        0.53       68.95
   .5671562 |         54        0.53       69.47
   .5685058 |         54        0.53       70.00
   .5706963 |         54        0.53       70.53
   .5727725 |         54        0.53       71.05
   .5796182 |         54        0.53       71.58
   .5855522 |         54        0.53       72.11
   .5863206 |         54        0.53       72.63
   .5901173 |         54        0.53       73.16
    .590777 |         54        0.53       73.68
   .5908308 |         54        0.53       74.21
   .5923496 |         54        0.53       74.74
   .5945377 |         54        0.53       75.26
   .5947065 |         54        0.53       75.79
    .598666 |         54        0.53       76.32
    .604336 |         54        0.53       76.84
   .6043786 |         54        0.53       77.37
   .6048128 |         54        0.53       77.89
   .6067832 |         54        0.53       78.42
   .6102364 |         54        0.53       78.95
   .6132551 |         54        0.53       79.47
   .6209794 |         54        0.53       80.00
   .6230419 |         54        0.53       80.53
   .6263981 |         54        0.53       81.05
   .6270945 |         54        0.53       81.58
   .6351011 |         54        0.53       82.11
   .6417275 |         54        0.53       82.63
   .6443115 |         54        0.53       83.16
    .647683 |         54        0.53       83.68
    .658599 |         54        0.53       84.21
   .6626686 |         54        0.53       84.74
   .6666803 |         54        0.53       85.26
   .6803523 |         54        0.53       85.79
   .6818182 |         54        0.53       86.32
    .689362 |         54        0.53       86.84
   .6926184 |         54        0.53       87.37
   .6931521 |         54        0.53       87.89
   .6998975 |         54        0.53       88.42
   .7008243 |         54        0.53       88.95
   .7027953 |         54        0.53       89.47
   .7037362 |         54        0.53       90.00
   .7062497 |         54        0.53       90.53
   .7063761 |         54        0.53       91.05
   .7066272 |         54        0.53       91.58
   .7152027 |         54        0.53       92.11
   .7153977 |         54        0.53       92.63
   .7164454 |         54        0.53       93.16
   .7455547 |         54        0.53       93.68
   .7464623 |         54        0.53       94.21
   .7503218 |         54        0.53       94.74
   .7566884 |         54        0.53       95.26
   .7656842 |         54        0.53       95.79
   .7761713 |         54        0.53       96.32
   .7927316 |         54        0.53       96.84
   .8054763 |         54        0.53       97.37
   .9314258 |         54        0.53       97.89
   .9579603 |         54        0.53       98.42
    .964451 |         54        0.53       98.95
   .9706801 |         54        0.53       99.47
   .9951162 |         54        0.53      100.00
------------+-----------------------------------
      Total |     10,260      100.00

. 
. *Change eff_reg to be between 0 and 1
. recode eff_reg_recRDU (0=0.0001)
(216 changes made to eff_reg_recRDU)

. recode eff_reg_recRDU (1=0.9999)
(54 changes made to eff_reg_recRDU)

. tab eff_reg_recRDU

eff_reg_rec |
        RDU |      Freq.     Percent        Cum.
------------+-----------------------------------
      .0001 |        216        2.21        2.21
   .0123227 |         54        0.55        2.76
    .024261 |         54        0.55        3.31
   .0263052 |         54        0.55        3.87
   .0430064 |         54        0.55        4.42
   .0443209 |         54        0.55        4.97
   .0497396 |         54        0.55        5.52
    .057886 |         54        0.55        6.08
   .0583839 |         54        0.55        6.63
   .0924831 |         54        0.55        7.18
   .1177218 |         54        0.55        7.73
   .1253968 |         54        0.55        8.29
   .1257485 |         54        0.55        8.84
   .1339977 |         54        0.55        9.39
   .1344078 |         54        0.55        9.94
   .1444646 |         54        0.55       10.50
   .1489456 |         54        0.55       11.05
   .1527878 |         54        0.55       11.60
   .1539539 |         54        0.55       12.15
   .1648709 |         54        0.55       12.71
   .1665364 |         54        0.55       13.26
   .1751184 |         54        0.55       13.81
   .1819072 |         54        0.55       14.36
   .1906944 |         54        0.55       14.92
   .1958855 |         54        0.55       15.47
   .2025557 |         54        0.55       16.02
   .2058718 |         54        0.55       16.57
   .2238656 |         54        0.55       17.13
   .2239661 |         54        0.55       17.68
    .226891 |         54        0.55       18.23
   .2282312 |         54        0.55       18.78
   .2329012 |         54        0.55       19.34
   .2442298 |         54        0.55       19.89
   .2444996 |         54        0.55       20.44
   .2449827 |         54        0.55       20.99
   .2491043 |         54        0.55       21.55
   .2537691 |         54        0.55       22.10
   .2555304 |         54        0.55       22.65
   .2587862 |         54        0.55       23.20
   .2590141 |         54        0.55       23.76
   .2634704 |         54        0.55       24.31
   .2653046 |         54        0.55       24.86
   .2694326 |         54        0.55       25.41
   .2707106 |         54        0.55       25.97
   .2717089 |         54        0.55       26.52
   .2750536 |         54        0.55       27.07
   .2772906 |         54        0.55       27.62
   .2894594 |         54        0.55       28.18
   .2903023 |         54        0.55       28.73
   .2952956 |         54        0.55       29.28
   .3055086 |         54        0.55       29.83
   .3106324 |         54        0.55       30.39
    .319751 |         54        0.55       30.94
   .3208703 |         54        0.55       31.49
   .3211733 |         54        0.55       32.04
   .3282499 |         54        0.55       32.60
   .3293723 |         54        0.55       33.15
   .3314234 |         54        0.55       33.70
   .3343246 |         54        0.55       34.25
   .3350192 |         54        0.55       34.81
   .3459748 |         54        0.55       35.36
    .348891 |         54        0.55       35.91
   .3528029 |         54        0.55       36.46
   .3568441 |         54        0.55       37.02
   .3621566 |         54        0.55       37.57
   .3629014 |         54        0.55       38.12
    .363277 |         54        0.55       38.67
   .3646627 |         54        0.55       39.23
   .3664107 |         54        0.55       39.78
   .3664748 |         54        0.55       40.33
   .3674543 |         54        0.55       40.88
   .3691197 |         54        0.55       41.44
   .3697151 |         54        0.55       41.99
   .3708192 |         54        0.55       42.54
   .3780083 |         54        0.55       43.09
   .3817527 |         54        0.55       43.65
     .38295 |         54        0.55       44.20
   .3853971 |         54        0.55       44.75
   .3886082 |         54        0.55       45.30
   .3896493 |         54        0.55       45.86
   .3909638 |         54        0.55       46.41
   .3910531 |         54        0.55       46.96
   .3931727 |         54        0.55       47.51
   .3932183 |         54        0.55       48.07
   .4002446 |         54        0.55       48.62
    .401612 |         54        0.55       49.17
   .4056275 |         54        0.55       49.72
   .4094209 |         54        0.55       50.28
   .4177766 |         54        0.55       50.83
   .4194984 |         54        0.55       51.38
   .4235357 |         54        0.55       51.93
   .4280786 |         54        0.55       52.49
   .4308821 |         54        0.55       53.04
   .4350504 |         54        0.55       53.59
   .4405698 |         54        0.55       54.14
     .44078 |         54        0.55       54.70
   .4426051 |         54        0.55       55.25
   .4426719 |         54        0.55       55.80
   .4453063 |         54        0.55       56.35
   .4467353 |         54        0.55       56.91
   .4494681 |         54        0.55       57.46
   .4572197 |         54        0.55       58.01
   .4573337 |         54        0.55       58.56
    .462642 |         54        0.55       59.12
    .466199 |         54        0.55       59.67
   .4674926 |         54        0.55       60.22
   .4679283 |         54        0.55       60.77
   .4732885 |         54        0.55       61.33
    .475707 |         54        0.55       61.88
   .4881828 |         54        0.55       62.43
   .4925759 |         54        0.55       62.98
   .4956136 |         54        0.55       63.54
   .5030423 |         54        0.55       64.09
   .5032951 |         54        0.55       64.64
   .5102375 |         54        0.55       65.19
    .510338 |         54        0.55       65.75
   .5139914 |         54        0.55       66.30
   .5149187 |         54        0.55       66.85
   .5172015 |         54        0.55       67.40
   .5200939 |         54        0.55       67.96
   .5220454 |         54        0.55       68.51
   .5230787 |         54        0.55       69.06
   .5285731 |         54        0.55       69.61
   .5316613 |         54        0.55       70.17
   .5318298 |         54        0.55       70.72
   .5381581 |         54        0.55       71.27
   .5387027 |         54        0.55       71.82
   .5496242 |         54        0.55       72.38
   .5505928 |         54        0.55       72.93
   .5534376 |         54        0.55       73.48
   .5635554 |         54        0.55       74.03
   .5666258 |         54        0.55       74.59
   .5781838 |         54        0.55       75.14
   .5807886 |         54        0.55       75.69
   .5820253 |         54        0.55       76.24
   .5836704 |         54        0.55       76.80
   .5884391 |         54        0.55       77.35
   .5952353 |         54        0.55       77.90
   .5992956 |         54        0.55       78.45
   .6034127 |         54        0.55       79.01
   .6073556 |         54        0.55       79.56
   .6077341 |         54        0.55       80.11
   .6105723 |         54        0.55       80.66
   .6154844 |         54        0.55       81.22
   .6199148 |         54        0.55       81.77
   .6210757 |         54        0.55       82.32
    .621631 |         54        0.55       82.87
   .6260242 |         54        0.55       83.43
   .6301962 |         54        0.55       83.98
   .6307207 |         54        0.55       84.53
   .6363453 |         54        0.55       85.08
   .6373123 |         54        0.55       85.64
    .645364 |         54        0.55       86.19
   .6474566 |         54        0.55       86.74
   .6482918 |         54        0.55       87.29
    .667065 |         54        0.55       87.85
   .6672566 |         54        0.55       88.40
   .6741394 |         54        0.55       88.95
   .6894564 |         54        0.55       89.50
   .6924225 |         54        0.55       90.06
   .6957546 |         54        0.55       90.61
   .7431053 |         54        0.55       91.16
   .7523714 |         54        0.55       91.71
   .7533249 |         54        0.55       92.27
   .7539797 |         54        0.55       92.82
   .7600335 |         54        0.55       93.37
   .7739003 |         54        0.55       93.92
   .7762405 |         54        0.55       94.48
   .7826692 |         54        0.55       95.03
   .7867535 |         54        0.55       95.58
   .8095617 |         54        0.55       96.13
   .8132561 |         54        0.55       96.69
   .8431038 |         54        0.55       97.24
   .9086104 |         54        0.55       97.79
   .9517534 |         54        0.55       98.34
   .9533199 |         54        0.55       98.90
    .994168 |         54        0.55       99.45
      .9999 |         54        0.55      100.00
------------+-----------------------------------
      Total |      9,774      100.00

. 
. * check the loading variables
. des loading*, fullnames

Variable      Storage   Display    Value
    name         type    format    label      Variable label
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
loading_experiment
                double  %10.0g                Value of parameter -loading- actually used in the experiments
loading_exact   double  %10.0g                Exact loading after rounding of exact premium to nearest $0.25
loading_rounding
                double  %10.0g                Loading adjustment due to rounding of premia
loadingfactor   double  %10.0g                loading factor
loading         float   %9.0g                 Fractional loading by design

. summ loading*

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
loading_e~nt |     10,908   -.0693069    .2257804        -.5         .2
loading_e~ct |     10,908   -.0688685    .2584471  -.5098039   .3194444
loading_ro~g |     10,908    .0004384    .0564932  -.1131868   .1194444
loadingfac~r |      5,508           1    .1633141         .8        1.2
     loading |      5,400        -.14    .2566688        -.5        .08

. 
. * check the N
. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646      3,726 |     6,372 
         1 |     2,862      1,674 |     4,536 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ae dnh_data if record==1, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        53         31 |        84 
         1 |        49         69 |       118 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ii dnh_data if record==1, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        49         69 |       118 
         1 |        53         31 |        84 
-----------+----------------------+----------
     Total |       102        100 |       202 

. 
. * look at violations
. tab rocl_subj_viol if record==1 & (ii==1 | ae==1)

       ROCL |
  Violation |
      Count |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          4        1.98        1.98
          1 |         17        8.42       10.40
          2 |         29       14.36       24.75
          3 |         40       19.80       44.55
          4 |         45       22.28       66.83
          5 |         23       11.39       78.22
          6 |         25       12.38       90.59
          7 |         13        6.44       97.03
          8 |          6        2.97      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab iiae_viol if record==1 & (ii==1 | ae==1)

iiae_viol_c |
       ount |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |          1        0.50        0.50
          2 |          4        1.98        2.48
        2.5 |         10        4.95        7.43
          3 |         25       12.38       19.80
        3.5 |         16        7.92       27.72
          4 |         23       11.39       39.11
        4.5 |         19        9.41       48.51
          5 |         40       19.80       68.32
        5.5 |         11        5.45       73.76
          6 |         30       14.85       88.61
        6.5 |          5        2.48       91.09
          7 |          9        4.46       95.54
        7.5 |          4        1.98       97.52
          8 |          4        1.98       99.50
          9 |          1        0.50      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab iiae_viol rocl_subj_viol if record==1 & (ii==1 | ae==1), all

iiae_viol_ |                                        ROCL Violation Count
     count |         0          1          2          3          4          5          6          7          8 |     Total
-----------+---------------------------------------------------------------------------------------------------+----------
         1 |         0          0          0          0          1          0          0          0          0 |         1 
         2 |         0          0          1          0          1          0          0          2          0 |         4 
       2.5 |         0          2          0          1          3          1          1          1          1 |        10 
         3 |         0          1          2          9          5          4          3          0          1 |        25 
       3.5 |         1          1          2          4          3          1          3          1          0 |        16 
         4 |         0          2          6          4          5          1          5          0          0 |        23 
       4.5 |         2          0          6          1          4          1          2          2          1 |        19 
         5 |         1          5          2          7          9          8          5          1          2 |        40 
       5.5 |         0          1          1          2          3          2          1          1          0 |        11 
         6 |         0          2          4          6         10          3          3          2          0 |        30 
       6.5 |         0          1          0          2          0          1          1          0          0 |         5 
         7 |         0          0          2          2          0          1          1          2          1 |         9 
       7.5 |         0          1          2          1          0          0          0          0          0 |         4 
         8 |         0          1          1          0          1          0          0          1          0 |         4 
         9 |         0          0          0          1          0          0          0          0          0 |         1 
-----------+---------------------------------------------------------------------------------------------------+----------
     Total |         4         17         29         40         45         23         25         13          6 |       202 

        Pearson chi2(112) = 101.1528   Pr = 0.759
Likelihood-ratio chi2(112) = 102.9635   Pr = 0.718
               Cramér's V =   0.2502
                    gamma =  -0.0354  ASE = 0.062
          Kendall's tau-b =  -0.0309  ASE = 0.054

. 
. * Create variable that is ``1'' if II and ``0'' is AE
. gen ii_ae=.
(10,908 missing values generated)

. replace ii_ae=0 if ae==1
(6,372 real changes made)

. replace ii_ae=1 if ii==1
(4,536 real changes made)

. tab ii_ae

      ii_ae |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      6,372       58.42       58.42
          1 |      4,536       41.58      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. 
. label def ii_ae_lab 0 "Actuarially Equivalent" 1 "Index Insurance"

. label values ii_ae ii_ae_lab 

. 
. * need a new SID to span OLD and DNH: do not replace SID, in case any later merges are needed!
. egen int SID_all = group(dnh_data SID)

. label variable SID_all "Sequential ID over both OLD and DNH data sets"

. 
. * save temporary file
. save tmp, replace
(file tmp.dta not found)
file tmp.dta saved

. 
. //For each of the variables, if they violate more than 50% of the cases, they are killer
. 
. * Roclkill 10 options to violate, so 11 options in total (0,1,2,3,4,5,6,7,8,9,10). With 6 or more --> roclkiller
. tab rocl_subj_viol

       ROCL |
  Violation |
      Count |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        216        1.98        1.98
          1 |        918        8.42       10.40
          2 |      1,566       14.36       24.75
          3 |      2,160       19.80       44.55
          4 |      2,430       22.28       66.83
          5 |      1,242       11.39       78.22
          6 |      1,350       12.38       90.59
          7 |        702        6.44       97.03
          8 |        324        2.97      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. bysort dnh_data: tab rocl_subj_viol if record==1

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> dnh_data = 0

       ROCL |
  Violation |
      Count |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          1        0.98        0.98
          1 |          8        7.84        8.82
          2 |         14       13.73       22.55
          3 |         22       21.57       44.12
          4 |         28       27.45       71.57
          5 |          9        8.82       80.39
          6 |         11       10.78       91.18
          7 |          6        5.88       97.06
          8 |          3        2.94      100.00
------------+-----------------------------------
      Total |        102      100.00

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> dnh_data = 1

       ROCL |
  Violation |
      Count |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          3        3.00        3.00
          1 |          9        9.00       12.00
          2 |         15       15.00       27.00
          3 |         18       18.00       45.00
          4 |         17       17.00       62.00
          5 |         14       14.00       76.00
          6 |         14       14.00       90.00
          7 |          7        7.00       97.00
          8 |          3        3.00      100.00
------------+-----------------------------------
      Total |        100      100.00


. 
. gen roclkill=.
(10,908 missing values generated)

. replace roclkill=1 if rocl_subj_viol>=6
(2,376 real changes made)

. replace roclkill=0 if rocl_subj_viol<6
(8,532 real changes made)

. tab roclkill rocl_subj_viol

           |                                        ROCL Violation Count
  roclkill |         0          1          2          3          4          5          6          7          8 |     Total
-----------+---------------------------------------------------------------------------------------------------+----------
         0 |       216        918      1,566      2,160      2,430      1,242          0          0          0 |     8,532 
         1 |         0          0          0          0          0          0      1,350        702        324 |     2,376 
-----------+---------------------------------------------------------------------------------------------------+----------
     Total |       216        918      1,566      2,160      2,430      1,242      1,350        702        324 |    10,908 

. 
. * text
. tab roclkill if record==1, missing

   roclkill |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        158       78.22       78.22
          1 |         44       21.78      100.00
------------+-----------------------------------
      Total |        202      100.00

. 
. * text
. tab dnh_data if record==1, missing

  Data from |
        DNH |
experiments |
    in 2019 |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        102       50.50       50.50
          1 |        100       49.50      100.00
------------+-----------------------------------
      Total |        202      100.00

. 
. * Rocl measured by compound risk loving. 8 options to violate. With 4 or more --> roclCRL
. tab rocl_viol_CRloving

       ROCL |
  Violation |
    Count - |
   Compound |
Risk Loving |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      1,134       10.40       10.40
          1 |      3,240       29.70       40.10
          2 |      2,322       21.29       61.39
          3 |      1,782       16.34       77.72
          4 |        918        8.42       86.14
          5 |        756        6.93       93.07
          6 |        432        3.96       97.03
          7 |        270        2.48       99.50
          8 |         54        0.50      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. gen roclCRL=.
(10,908 missing values generated)

. replace roclCRL=1 if rocl_viol_CRloving>3
(2,430 real changes made)

. replace roclCRL=0 if rocl_viol_CRloving<=3
(8,478 real changes made)

. tab roclCRL if record==1

    roclCRL |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        157       77.72       77.72
          1 |         45       22.28      100.00
------------+-----------------------------------
      Total |        202      100.00

. 
. * Rocl measured by compound risk aversion. 8 options to violate. With 4 or more --> roclCRA
. tab rocl_viol_CRaversion if record==1

       ROCL |
  Violation |
    Count - |
   Compound |
       Risk |
   Aversion |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         66       32.67       32.67
          1 |         54       26.73       59.41
          2 |         33       16.34       75.74
          3 |         24       11.88       87.62
          4 |         15        7.43       95.05
          5 |          8        3.96       99.01
          6 |          1        0.50       99.50
          7 |          1        0.50      100.00
------------+-----------------------------------
      Total |        202      100.00

. gen roclCRA=.
(10,908 missing values generated)

. replace roclCRA=1 if rocl_viol_CRaversion>3
(1,350 real changes made)

. replace roclCRA=0 if rocl_viol_CRaversion<=3
(9,558 real changes made)

. tab roclCRA if record==1

    roclCRA |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        177       87.62       87.62
          1 |         25       12.38      100.00
------------+-----------------------------------
      Total |        202      100.00

. 
. * check pattern
. tab roclCRL roclCRA if record==1

           |        roclCRA
   roclCRL |         0          1 |     Total
-----------+----------------------+----------
         0 |       133         24 |       157 
         1 |        44          1 |        45 
-----------+----------------------+----------
     Total |       177         25 |       202 

. bysort dnh_data: tab roclCRL roclCRA if record==1

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> dnh_data = 0

           |        roclCRA
   roclCRL |         0          1 |     Total
-----------+----------------------+----------
         0 |        68          8 |        76 
         1 |        25          1 |        26 
-----------+----------------------+----------
     Total |        93          9 |       102 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> dnh_data = 1

           |        roclCRA
   roclCRL |         0          1 |     Total
-----------+----------------------+----------
         0 |        65         16 |        81 
         1 |        19          0 |        19 
-----------+----------------------+----------
     Total |        84         16 |       100 


. 
. tab roclkill roclCRA if record==1

           |        roclCRA
  roclkill |         0          1 |     Total
-----------+----------------------+----------
         0 |       149          9 |       158 
         1 |        28         16 |        44 
-----------+----------------------+----------
     Total |       177         25 |       202 

. tab roclkill roclCRL if record==1

           |        roclCRL
  roclkill |         0          1 |     Total
-----------+----------------------+----------
         0 |       140         18 |       158 
         1 |        17         27 |        44 
-----------+----------------------+----------
     Total |       157         45 |       202 

. 
. gen rocl_category=.
(10,908 missing values generated)

. replace rocl_category=0
(10,908 real changes made)

. replace rocl_category=3 if roclCRL==1
(2,430 real changes made)

. replace rocl_category=2 if roclCRA==1
(1,350 real changes made)

. replace rocl_category=1 if roclCRL!=1 & roclkill==1 & roclCRA!=1
(108 real changes made)

. tab rocl_category if record==1

rocl_catego |
         ry |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        131       64.85       64.85
          1 |          2        0.99       65.84
          2 |         25       12.38       78.22
          3 |         44       21.78      100.00
------------+-----------------------------------
      Total |        202      100.00

. 
. tab roclCRA if record==1 // 9 individuals

    roclCRA |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        177       87.62       87.62
          1 |         25       12.38      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab roclCRL if record==1 // 26 individuals

    roclCRL |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        157       77.72       77.72
          1 |         45       22.28      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab roclCRA roclCRL if record==1

           |        roclCRL
   roclCRA |         0          1 |     Total
-----------+----------------------+----------
         0 |       133         44 |       177 
         1 |        24          1 |        25 
-----------+----------------------+----------
     Total |       157         45 |       202 

. 
. tab roclkill if record==1

   roclkill |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        158       78.22       78.22
          1 |         44       21.78      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab rocl_category roclkill if record==1

rocl_categ |       roclkill
       ory |         0          1 |     Total
-----------+----------------------+----------
         0 |       131          0 |       131 
         1 |         0          2 |         2 
         2 |         9         16 |        25 
         3 |        18         26 |        44 
-----------+----------------------+----------
     Total |       158         44 |       202 

. tab rocl_category roclCRA if record==1

rocl_categ |        roclCRA
       ory |         0          1 |     Total
-----------+----------------------+----------
         0 |       131          0 |       131 
         1 |         2          0 |         2 
         2 |         0         25 |        25 
         3 |        44          0 |        44 
-----------+----------------------+----------
     Total |       177         25 |       202 

. tab rocl_category roclCRL if record==1

rocl_categ |        roclCRL
       ory |         0          1 |     Total
-----------+----------------------+----------
         0 |       131          0 |       131 
         1 |         2          0 |         2 
         2 |        24          1 |        25 
         3 |         0         44 |        44 
-----------+----------------------+----------
     Total |       157         45 |       202 

. 
. gen noroclkill=.
(10,908 missing values generated)

. replace noroclkill=1 if roclkill==0
(8,532 real changes made)

. replace noroclkill=0 if roclkill==1
(2,376 real changes made)

. tab noroclkill

 noroclkill |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      2,376       21.78       21.78
          1 |      8,532       78.22      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. 
. tab roclkill if record==1

   roclkill |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        158       78.22       78.22
          1 |         44       21.78      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab roclCRA if record==1

    roclCRA |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        177       87.62       87.62
          1 |         25       12.38      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab roclCRL if record==1

    roclCRL |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        157       77.72       77.72
          1 |         45       22.28      100.00
------------+-----------------------------------
      Total |        202      100.00

. tab noroclkill if record==1

 noroclkill |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         44       21.78       21.78
          1 |        158       78.22      100.00
------------+-----------------------------------
      Total |        202      100.00

. 
. gen gpaHIGH=0

. replace gpaHIGH=1 if gpaHI==1 | gpaVHI==1
(6,588 real changes made)

. tab gpaHIGH

    gpaHIGH |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      4,320       39.60       39.60
          1 |      6,588       60.40      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. 
. 
. ////////////////////////////////////////////////////////////////////////////////
> ///////////////////////.   Set globals /////////////////////////////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. * DNH does not have christian as covariate
. global demog_reg  "female age black business single nhhd working money"

. global actuarial "probLOSS amountLOSS loading m"

. global rocl "rocl_subj_viol rocl_subj_viol2"

. 
. * for OLD, use the exact loading (where loading_experiment is the design loading)
. replace loading = loading_exact if dnh_data==0
(5,508 real changes made)

. 
. * Create global with normalized variables
. foreach i in $rocl $actuarial {
  2.         summ `i'
  3.         norm `i', method(mmx)
  4.         gen `i'norm=mmx_`i'
  5.         summ `i'norm
  6.         }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_subj_~l |     10,908    3.856436     1.86805          0          8

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_subj_~m |     10,908    .4820545    .2335062          0          1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_subj_~2 |     10,908    18.36139    15.68678          0         64

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rocl_s~2norm |     10,908    .2868967     .245106          0          1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    probLOSS |     10,908    .1333333    .0471426         .1         .2

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
probLOSSnorm |     10,908    .3333333    .4714261          0          1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  amountLOSS |     10,908     32.9703    6.569741         20         39

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
amountLOSS~m |     10,908    .6826472    .3457758          0          1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     loading |     10,908   -.0696904    .2587638        -.5   .3194444

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 loadingnorm |     10,908    .5251236    .3157796          0          1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
           m |     10,854    .6256219    .2972066          0          1
(54 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
       mnorm |     10,854    .6256219    .2972066          0          1

. 
. global actuarial_norm "probLOSSnorm amountLOSSnorm loadingnorm mnorm"

. global rocl_norm "rocl_subj_violnorm rocl_subj_viol2norm"

. 
. 
. ////////////////////////////////////////////////////////////////////////////////
> ///////////////////////.   Label variables  ////////////////////////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. la var probLOSSnorm "Personal Loss Probability"

. la var amountLOSSnorm "Loss Amount"

. la var loadingnorm "Fractional Loading"

. la var mnorm "Correlation of Index and Personal Loss"

. 
. la var rocl_subj_viol "Number of ROCL violations"

. la var rocl_subj_violnorm "Number of ROCL violations"

. la var rocl_subj_viol2 "Number of ROCL violations squared"

. la var rocl_subj_viol2norm "Number of ROCL violations squared"

. 
. * check -- some missing for rocl_subj_viol for DNH data
. bysort dnh_data: summ loading loadingnorm rocl_subj_viol

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> dnh_data = 0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     loading |      5,508   -.0007594    .2417226  -.3131868   .3194444
 loadingnorm |      5,508    .6092427    .2949836   .2279754          1
rocl_subj_~l |      5,508    3.833333    1.766309          0          8

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> dnh_data = 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     loading |      5,400        -.14    .2566688        -.5        .08
 loadingnorm |      5,400     .439322    .3132229          0   .7077966
rocl_subj_~l |      5,400        3.88    1.966295          0          8


. 
. 
. ////////////////////////////////////////////////////////////////////////////////
> /////////////////////////////// ROCL Violations Graphs//////////////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. * get Fisher Exact test for paper
. tab rocl_subj_viol ae if record == 1 & dnh_data==0, exact

Enumerating sample-space combinations:
stage 9:  enumerations = 1
stage 8:  enumerations = 2
stage 7:  enumerations = 7
stage 6:  enumerations = 32
stage 5:  enumerations = 109
stage 4:  enumerations = 231
stage 3:  enumerations = 476
stage 2:  enumerations = 920
stage 1:  enumerations = 0

           |    Index isurance
 Number of | actuarially-equivalen
      ROCL |    t lottery frame
violations |         0          1 |     Total
-----------+----------------------+----------
         0 |         0          1 |         1 
         1 |         7          1 |         8 
         2 |         8          6 |        14 
         3 |        12         10 |        22 
         4 |        12         16 |        28 
         5 |         6          3 |         9 
         6 |         5          6 |        11 
         7 |         2          4 |         6 
         8 |         1          2 |         3 
-----------+----------------------+----------
     Total |        53         49 |       102 

           Fisher's exact =                 0.381

. tab rocl_subj_viol ae if record == 1 & dnh_data==1, exact

Enumerating sample-space combinations:
stage 9:  enumerations = 1
stage 8:  enumerations = 4
stage 7:  enumerations = 9
stage 6:  enumerations = 33
stage 5:  enumerations = 134
stage 4:  enumerations = 536
stage 3:  enumerations = 1115
stage 2:  enumerations = 2761
stage 1:  enumerations = 0

           |    Index isurance
 Number of | actuarially-equivalen
      ROCL |    t lottery frame
violations |         0          1 |     Total
-----------+----------------------+----------
         0 |         0          3 |         3 
         1 |         4          5 |         9 
         2 |         3         12 |        15 
         3 |         5         13 |        18 
         4 |         3         14 |        17 
         5 |         6          8 |        14 
         6 |         7          7 |        14 
         7 |         3          4 |         7 
         8 |         0          3 |         3 
-----------+----------------------+----------
     Total |        31         69 |       100 

           Fisher's exact =                 0.353

. tab rocl_subj_viol ae if record == 1, exact(2)

Enumerating sample-space combinations:
stage 9:  enumerations = 1
stage 8:  enumerations = 5
stage 7:  enumerations = 30
stage 6:  enumerations = 204
stage 5:  enumerations = 1292
stage 4:  enumerations = 6598
stage 3:  enumerations = 28661
stage 2:  enumerations = 101053
stage 1:  enumerations = 0

           |    Index isurance
 Number of | actuarially-equivalen
      ROCL |    t lottery frame
violations |         0          1 |     Total
-----------+----------------------+----------
         0 |         0          4 |         4 
         1 |        11          6 |        17 
         2 |        11         18 |        29 
         3 |        17         23 |        40 
         4 |        15         30 |        45 
         5 |        12         11 |        23 
         6 |        12         13 |        25 
         7 |         5          8 |        13 
         8 |         1          5 |         6 
-----------+----------------------+----------
     Total |        84        118 |       202 

           Fisher's exact =                 0.223

. 
. * check the N
. tab ae dnh_data, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,862      1,674 |     4,536 
         1 |     2,646      3,726 |     6,372 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ii dnh_data, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,646      3,726 |     6,372 
         1 |     2,862      1,674 |     4,536 
-----------+----------------------+----------
     Total |     5,508      5,400 |    10,908 

. tab ae dnh_data if record==1, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        53         31 |        84 
         1 |        49         69 |       118 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ii dnh_data if record==1, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        49         69 |       118 
         1 |        53         31 |        84 
-----------+----------------------+----------
     Total |       102        100 |       202 

. 
. * Figure 4
.         tab rocl_subj_viol

  Number of |
       ROCL |
 violations |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        216        1.98        1.98
          1 |        918        8.42       10.40
          2 |      1,566       14.36       24.75
          3 |      2,160       19.80       44.55
          4 |      2,430       22.28       66.83
          5 |      1,242       11.39       78.22
          6 |      1,350       12.38       90.59
          7 |        702        6.44       97.03
          8 |        324        2.97      100.00
------------+-----------------------------------
      Total |     10,908      100.00

.         histogram rocl_subj_viol, discrete fraction fcolor(navy) lcolor(navy) gap(20) ytitle(Fraction, orient(horizontal)) ylabel(#10, labels valuelabel grid angle(horizontal)) ymtick(#10) xlabel(0(1)10, valu
> elabel) xtitle("Number of ROCL Violations", margin(medium)) xscale(range(0.4 4)) legend(off) saving(FigROCLviolationsALL.gph, replace)
(start=0, width=1)
file FigROCLviolationsALL.gph saved

.         gr export FigROCLviolationsALL.png, replace
file FigROCLviolationsALL.png saved as PNG format

.         
. log on app      
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:01

. 
. * Tabulation of ROCL violations.        
. *********************************
. * Regenerate with one observation per subject (will be the same shape)
.         tab rocl_subj_viol if record==1

  Number of |
       ROCL |
 violations |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          4        1.98        1.98
          1 |         17        8.42       10.40
          2 |         29       14.36       24.75
          3 |         40       19.80       44.55
          4 |         45       22.28       66.83
          5 |         23       11.39       78.22
          6 |         25       12.38       90.59
          7 |         13        6.44       97.03
          8 |          6        2.97      100.00
------------+-----------------------------------
      Total |        202      100.00

.         histogram rocl_subj_viol if record==1, discrete fraction fcolor(navy) lcolor(navy) gap(20) ytitle(Fraction, orient(horizontal)) ylabel(#10, labels valuelabel grid angle(horizontal)) ymtick(#10) xlabel
> (0(1)10, valuelabel) xtitle("Number of ROCL Violations", margin(medium)) xscale(range(0.4 4)) legend(off) saving(FigROCLviolationsALL.gph, replace)
(start=0, width=1)
file FigROCLviolationsALL.gph saved

.         gr export FigROCLviolationsALL.png, replace
file FigROCLviolationsALL.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:02
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. 
. 
. ////////////////////////////////////////////////////////////////////////////////
> ///////////////////// Balance Table      ///////////////////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. * Table 2
. 
. * check the N
. tab ae dnh_data if record==1, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        53         31 |        84 
         1 |        49         69 |       118 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ii dnh_data if record==1, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        49         69 |       118 
         1 |        53         31 |        84 
-----------+----------------------+----------
     Total |       102        100 |       202 

. 
. * Generate age in total years.
. gen age_total = age + 15

. 
. * stuff to check for balance
. global balancevars "female age_total black single nhhd business gpaHIGH working money rocl_subj_viol"

. 
. * original command
. capture: drop DNH_balance.tex

. capture: drop DNH_balance1.xlsx

. capture: drop DNH_balance1.tex

. iebaltab $balancevars if record==1 & (ii_ae==0|ii_ae==1), grpvar(ii_ae) control(0) stats(desc(sd) pair(diff)) savexlsx(DNH_balance1) grplabels(0 AE @ 1 II) rowlabels(female Female @ age_total Age in years @ b
> lack Black @ business Business major @gpaHIGH High GPA @ single Single @ nhhd Household members @ working Working part-time or full-time @ money Money spent per day @ rocl_subj_viol ROCL violations) replace f
> test rowvarlabel

    Balance table saved in Excel format to: DNH_balance1.xlsx

. iebaltab $balancevars if record==1 & (ii_ae==0|ii_ae==1), grpvar(ii_ae) control(0) stats(desc(sd) pair(diff)) savetex(DNH_balance1) grplabels(0 AE @ 1 II) rowlabels(female Female @ age_total Age in years @ bl
> ack Black @ business Business major @gpaHIGH High GPA @ single Single @ nhhd Household members @ working Working part-time or full-time @ money Money spent per day @ rocl_subj_viol ROCL violations) replace ft
> est rowvarlabel

    Balance table saved in LaTeX format to: DNH_balance1.tex

. 
. * see if onerow works after dropping rocl_subj_viol
. global balancevars "female age_total black single nhhd business gpaHIGH working money"

. capture: drop DNH_balance2.xlsx

. capture: drop DNH_balance2.tex

. iebaltab $balancevars if record==1 & (ii_ae==0|ii_ae==1), grpvar(ii_ae) control(0) stats(desc(sd) pair(diff)) savexlsx(DNH_balance2) grplabels(0 AE @ 1 II) rowlabels(female Female @ age_total Age in years @ b
> lack Black @ business Business major @gpaHIGH High GPA @ single Single @ nhhd Household members @ working Working part-time or full-time @ money Money spent per day) replace onerow ftest rowvarlabel

    Balance table saved in Excel format to: DNH_balance2.xlsx

. iebaltab $balancevars if record==1 & (ii_ae==0|ii_ae==1), grpvar(ii_ae) control(0) stats(desc(sd) pair(diff)) savetex(DNH_balance2) grplabels(0 AE @ 1 II) rowlabels(female Female @ age_total Age in years @ bl
> ack Black @ business Business major @gpaHIGH High GPA @ single Single @ nhhd Household members @ working Working part-time or full-time @ money Money spent per day) replace onerow ftest rowvarlabel

    Balance table saved in LaTeX format to: DNH_balance2.tex

. 
. * since we are now balanced, use onerow
. global balancevars "female age_total black single nhhd business gpaHIGH working money rocl_subj_viol"

. capture: drop DNH_balance3.xlsx

. capture: drop DNH_balance3.tex

. iebaltab $balancevars if record==1 & (ii_ae==0|ii_ae==1), grpvar(ii_ae) control(0) stats(desc(sd) pair(diff)) savexlsx(DNH_balance3) grplabels(0 AE @ 1 II) rowlabels(female Female @ age_total Age in years @ b
> lack Black @ business Business major @gpaHIGH High GPA @ single Single @ nhhd Household members @ working Working part-time or full-time @ money Money spent per day @ rocl_subj_viol ROCL violations) replace o
> nerow ftest rowvarlabel

    Balance table saved in Excel format to: DNH_balance3.xlsx

. iebaltab $balancevars if record==1 & (ii_ae==0|ii_ae==1), grpvar(ii_ae) control(0) stats(desc(sd) pair(diff)) savetex(DNH_balance3) grplabels(0 AE @ 1 II) rowlabels(female Female @ age_total Age in years @ bl
> ack Black @ business Business major @gpaHIGH High GPA @ single Single @ nhhd Household members @ working Working part-time or full-time @ money Money spent per day @ rocl_subj_viol ROCL violations) replace on
> erow ftest rowvarlabel

    Balance table saved in LaTeX format to: DNH_balance3.tex

. 
. 
. * Figure 4
. 
. * save temporary file
. save tmp, replace
file tmp.dta saved

. 
. * check the N
. tab ae dnh_data if record==1, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        53         31 |        84 
         1 |        49         69 |       118 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ii dnh_data if record==1, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        49         69 |       118 
         1 |        53         31 |        84 
-----------+----------------------+----------
     Total |       102        100 |       202 

. 
. * -- no longer any missing rosl_subj_viol
. tab rocl_subj_viol, missing

  Number of |
       ROCL |
 violations |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        216        1.98        1.98
          1 |        918        8.42       10.40
          2 |      1,566       14.36       24.75
          3 |      2,160       19.80       44.55
          4 |      2,430       22.28       66.83
          5 |      1,242       11.39       78.22
          6 |      1,350       12.38       90.59
          7 |        702        6.44       97.03
          8 |        324        2.97      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. 
. * setup for panel data on purchases
. xtset SID_all record 

Panel variable: SID_all (strongly balanced)
 Time variable: record, 1 to 54
         Delta: 1 unit

. 
. ***********************************************************************************
. * Simple analysis of purchase by ROCL violators and ROCL compliers
. ***********************************************************************************
. 
. * Overall choices
. 
. * text for overall purchase
. tab purchase

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      4,428       40.80       40.80
          1 |      6,426       59.20      100.00
------------+-----------------------------------
      Total |     10,854      100.00

. tab purchase ii_ae, row nofreq

           |         ii_ae
    Choice | Actuarial  Index Ins |     Total
-----------+----------------------+----------
         0 |     58.49      41.51 |    100.00 
         1 |     58.01      41.99 |    100.00 
-----------+----------------------+----------
     Total |     58.21      41.79 |    100.00 

. tab purchase ii_ae, exact

           |         ii_ae
    Choice | Actuarial  Index Ins |     Total
-----------+----------------------+----------
         0 |     2,590      1,838 |     4,428 
         1 |     3,728      2,698 |     6,426 
-----------+----------------------+----------
     Total |     6,318      4,536 |    10,854 

           Fisher's exact =                 0.635
   1-sided Fisher's exact =                 0.317

. 
. * Text for overall purchase of ROCL killers
. tab purchase if roclkill ==1

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        861       36.24       36.24
          1 |      1,515       63.76      100.00
------------+-----------------------------------
      Total |      2,376      100.00

. tab purchase if roclkill ==0

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      3,567       42.07       42.07
          1 |      4,911       57.93      100.00
------------+-----------------------------------
      Total |      8,478      100.00

. 
. * Text for overall purchase of ROCL killers
. 
. tab purchase if ii_ae ==0 & roclkill ==1

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        571       40.67       40.67
          1 |        833       59.33      100.00
------------+-----------------------------------
      Total |      1,404      100.00

. tab purchase if ii_ae ==1 & roclkill ==1

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        290       29.84       29.84
          1 |        682       70.16      100.00
------------+-----------------------------------
      Total |        972      100.00

. tab purchase ii_ae if roclkill ==1, exact

           |         ii_ae
    Choice | Actuarial  Index Ins |     Total
-----------+----------------------+----------
         0 |       571        290 |       861 
         1 |       833        682 |     1,515 
-----------+----------------------+----------
     Total |     1,404        972 |     2,376 

           Fisher's exact =                 0.000
   1-sided Fisher's exact =                 0.000

. 
. tab purchase if ii_ae ==0 & roclkill ==0

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      2,019       41.09       41.09
          1 |      2,895       58.91      100.00
------------+-----------------------------------
      Total |      4,914      100.00

. tab purchase if ii_ae ==1 & roclkill ==0

     Choice |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      1,548       43.43       43.43
          1 |      2,016       56.57      100.00
------------+-----------------------------------
      Total |      3,564      100.00

. tab purchase ii_ae if roclkill ==0, exact

           |         ii_ae
    Choice | Actuarial  Index Ins |     Total
-----------+----------------------+----------
         0 |     2,019      1,548 |     3,567 
         1 |     2,895      2,016 |     4,911 
-----------+----------------------+----------
     Total |     4,914      3,564 |     8,478 

           Fisher's exact =                 0.032
   1-sided Fisher's exact =                 0.016

. 
. 
. * text for correct choices
. tab correct_rdu

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      5,464       50.09       50.09
          1 |      5,444       49.91      100.00
------------+-----------------------------------
      Total |     10,908      100.00

. tab correct_rdu ii_ae, row nofreq

   Correct |
   choices |
     made, |
 given RDU |
      risk |
preference |         ii_ae
         s | Actuarial  Index Ins |     Total
-----------+----------------------+----------
         0 |     58.69      41.31 |    100.00 
         1 |     58.14      41.86 |    100.00 
-----------+----------------------+----------
     Total |     58.42      41.58 |    100.00 

. tab correct_rdu ii_ae, exact

   Correct |
   choices |
     made, |
 given RDU |
      risk |
preference |         ii_ae
         s | Actuarial  Index Ins |     Total
-----------+----------------------+----------
         0 |     3,207      2,257 |     5,464 
         1 |     3,165      2,279 |     5,444 
-----------+----------------------+----------
     Total |     6,372      4,536 |    10,908 

           Fisher's exact =                 0.560
   1-sided Fisher's exact =                 0.284

. 
. * Text for overall for correct choices of ROCL killers
. tab correct_rdu if roclkill ==1

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      1,246       52.44       52.44
          1 |      1,130       47.56      100.00
------------+-----------------------------------
      Total |      2,376      100.00

. tab correct_rdu if roclkill ==0

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      4,218       49.44       49.44
          1 |      4,314       50.56      100.00
------------+-----------------------------------
      Total |      8,532      100.00

. 
. * Text for overall for correct choices of ROCL killers in AE
. tab correct_rdu if roclkill ==1 & ii_ae==0

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        704       50.14       50.14
          1 |        700       49.86      100.00
------------+-----------------------------------
      Total |      1,404      100.00

. tab correct_rdu if roclkill ==0 & ii_ae==0

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      2,503       50.38       50.38
          1 |      2,465       49.62      100.00
------------+-----------------------------------
      Total |      4,968      100.00

. tab correct_rdu roclkill if ii_ae==0, exact

   Correct |
   choices |
     made, |
 given RDU |
      risk |
preference |       roclkill
         s |         0          1 |     Total
-----------+----------------------+----------
         0 |     2,503        704 |     3,207 
         1 |     2,465        700 |     3,165 
-----------+----------------------+----------
     Total |     4,968      1,404 |     6,372 

           Fisher's exact =                 0.880
   1-sided Fisher's exact =                 0.449

. 
. * Text for overall for correct choices of ROCL killers in II
. tab correct_rdu if roclkill ==1 & ii_ae==1

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        542       55.76       55.76
          1 |        430       44.24      100.00
------------+-----------------------------------
      Total |        972      100.00

. tab correct_rdu if roclkill ==0 & ii_ae==1

    Correct |
    choices |
made, given |
   RDU risk |
preferences |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      1,715       48.12       48.12
          1 |      1,849       51.88      100.00
------------+-----------------------------------
      Total |      3,564      100.00

. tab correct_rdu roclkill if ii_ae==1, exact

   Correct |
   choices |
     made, |
 given RDU |
      risk |
preference |       roclkill
         s |         0          1 |     Total
-----------+----------------------+----------
         0 |     1,715        542 |     2,257 
         1 |     1,849        430 |     2,279 
-----------+----------------------+----------
     Total |     3,564        972 |     4,536 

           Fisher's exact =                 0.000
   1-sided Fisher's exact =                 0.000

. 
. * Overall choices
. * Purchase of ROCL violators
. sum purchase if roclkill == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      2,376    .6376263    .4807872          0          1

. 
. * Purchase of ROCL compliers
. sum purchase if roclkill == 0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      8,478     .579264    .4937064          0          1

. 
. log on app
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:04

. 
. * Tabulations for Table 3
. **************************
. 
. * Choices in the AE treatment: text Table 3
. 
. * Purchase of ROCL violators in AE treatment
. sum purchase if roclkill == 1 & ii_ae == 0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      1,404    .5933048    .4913921          0          1

. 
. * Purchase of ROCL compliers in AE treatment
. sum purchase if roclkill == 0 & ii_ae == 0 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      4,914    .5891331    .4920412          0          1

. 
. * Difference in means test in AE treatment
. ttest purchase if ii_ae == 0, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   4,914    .5891331    .0070191    .4920412    .5753724    .6028937
       1 |   1,404    .5933048    .0131143    .4913921    .5675791    .6190306
---------+--------------------------------------------------------------------
Combined |   6,318    .5900601     .006188    .4918612    .5779295    .6021908
---------+--------------------------------------------------------------------
    diff |           -.0041718    .0148855               -.0333524    .0250088
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.2803
H0: diff = 0                                     Degrees of freedom =     6316

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.3896         Pr(|T| > |t|) = 0.7793          Pr(T > t) = 0.6104

. 
. * Choices in the II treatment: text Table 3
. * Purchase of ROCL violators in AE treatment
. sum purchase if roclkill == 1 & ii_ae == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |        972    .7016461    .4577712          0          1

. 
. * Purchase of ROCL compliers in AE treatment
. sum purchase if roclkill == 0 & ii_ae == 1 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      3,564    .5656566      .49574          0          1

. 
. * Difference in means test in II treatment
. ttest purchase if ii_ae == 1, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   3,564    .5656566     .008304      .49574    .5493756    .5819376
       1 |     972    .7016461     .014683    .4577712     .672832    .7304602
---------+--------------------------------------------------------------------
Combined |   4,536    .5947972    .0072901    .4909854    .5805051    .6090893
---------+--------------------------------------------------------------------
    diff |           -.1359895    .0176534               -.1705987   -.1013803
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -7.7033
H0: diff = 0                                     Degrees of freedom =     4534

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. 
. * Difference in means test in across treatments by ROCL violator
. ttest purchase if roclkill == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   1,404    .5933048    .0131143    .4913921    .5675791    .6190306
Index In |     972    .7016461     .014683    .4577712     .672832    .7304602
---------+--------------------------------------------------------------------
Combined |   2,376    .6376263    .0098635    .4807872    .6182844    .6569682
---------+--------------------------------------------------------------------
    diff |           -.1083412     .019942               -.1474467   -.0692358
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =  -5.4328
H0: diff = 0                                     Degrees of freedom =     2374

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. 
. * Difference in means test in across treatments by ROCL complier
. ttest purchase if roclkill == 0, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   4,914    .5891331    .0070191    .4920412    .5753724    .6028937
Index In |   3,564    .5656566     .008304      .49574    .5493756    .5819376
---------+--------------------------------------------------------------------
Combined |   8,478     .579264    .0053619    .4937064    .5687533    .5897747
---------+--------------------------------------------------------------------
    diff |            .0234765    .0108601                 .002188     .044765
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =   2.1617
H0: diff = 0                                     Degrees of freedom =     8476

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9847         Pr(|T| > |t|) = 0.0307          Pr(T > t) = 0.0153

. 
. 
. * Tabulations of correct choices for Table 4:
. ********************************************
. 
. * Purchase of ROCL violators in AE treatment
. sum correct_rdu if roclkill == 1 & ii_ae == 0 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |      1,404    .4985755    .5001761          0          1

. 
. * Purchase of ROCL compliers in AE treatment
. sum correct_rdu if roclkill == 0 & ii_ae == 0 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |      4,968    .4961755    .5000357          0          1

. 
. * Difference in means test in AE treatment
. ttest correct_rdu if ii_ae == 0, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   4,968    .4961755    .0070943    .5000357    .4822675    .5100835
       1 |   1,404    .4985755    .0133487    .5001761    .4723899    .5247611
---------+--------------------------------------------------------------------
Combined |   6,372    .4967043    .0062641    .5000284    .4844246     .508984
---------+--------------------------------------------------------------------
    diff |              -.0024    .0151144               -.0320293    .0272294
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.1588
H0: diff = 0                                     Degrees of freedom =     6370

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4369         Pr(|T| > |t|) = 0.8738          Pr(T > t) = 0.5631

. 
. 
. * Purchase of ROCL violators in II treatment
. sum correct_rdu if roclkill == 1 & ii_ae == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |        972    .4423868    .4969253          0          1

. 
. * Purchase of ROCL compliers in II treatment
. sum correct_rdu if roclkill == 0 & ii_ae == 1 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |      3,564    .5187991    .4997166          0          1

. 
. * Difference in means test in II treatment
. ttest correct_rdu if ii_ae == 1, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   3,564    .5187991    .0083706    .4997166    .5023875    .5352107
       1 |     972    .4423868    .0159389    .4969253    .4111082    .4736655
---------+--------------------------------------------------------------------
Combined |   4,536     .502425    .0074247    .5000492    .4878691     .516981
---------+--------------------------------------------------------------------
    diff |            .0764123    .0180609                .0410041    .1118205
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   4.2308
H0: diff = 0                                     Degrees of freedom =     4534

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

. 
. 
. * Difference in means test in across treatments by ROCL violator
. ttest correct_rdu  if roclkill == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   1,404    .4985755    .0133487    .5001761    .4723899    .5247611
Index In |     972    .4423868    .0159389    .4969253    .4111082    .4736655
---------+--------------------------------------------------------------------
Combined |   2,376    .4755892    .0102475    .4995089    .4554942    .4956843
---------+--------------------------------------------------------------------
    diff |            .0561887     .020815                .0153713    .0970061
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =   2.6994
H0: diff = 0                                     Degrees of freedom =     2374

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9965         Pr(|T| > |t|) = 0.0070          Pr(T > t) = 0.0035

. 
. * Difference in means test in across treatments by ROCL complier
. ttest correct_rdu  if roclkill == 0, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   4,968    .4961755    .0070943    .5000357    .4822675    .5100835
Index In |   3,564    .5187991    .0083706    .4997166    .5023875    .5352107
---------+--------------------------------------------------------------------
Combined |   8,532    .5056259    .0054131    .4999977     .495015    .5162368
---------+--------------------------------------------------------------------
    diff |           -.0226236    .0109736               -.0441346   -.0011126
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =  -2.0616
H0: diff = 0                                     Degrees of freedom =     8530

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0196         Pr(|T| > |t|) = 0.0393          Pr(T > t) = 0.9804

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:04
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. 
. 
. ****************************************************
. * Simple Analysis of actuarial parameters
. ****************************************************
. 
. * check the N
. tab ae dnh_data if record==1, missing

     Index |
  isurance |
actuariall |
y-equivale |     Data from DNH
nt lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        53         31 |        84 
         1 |        49         69 |       118 
-----------+----------------------+----------
     Total |       102        100 |       202 

. tab ii dnh_data if record==1, missing

     Index |
 insurance |
  compound |     Data from DNH
   lottery |  experiments in 2019
     frame |         0          1 |     Total
-----------+----------------------+----------
         0 |        49         69 |       118 
         1 |        53         31 |        84 
-----------+----------------------+----------
     Total |       102        100 |       202 

. summ purchase $actuarial

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |     10,854    .5920398    .4914783          0          1
    probLOSS |     10,908    .1333333    .0471426         .1         .2
  amountLOSS |     10,908     32.9703    6.569741         20         39
     loading |     10,908   -.0696904    .2587638        -.5   .3194444
           m |     10,854    .6256219    .2972066          0          1

. 
. log on app
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:04

. 
. * log for Figures 6 and 7
. 
. * logit
. logit purchase $actuarial

Iteration 0:  Log likelihood = -7338.4711  
Iteration 1:  Log likelihood = -7327.3238  
Iteration 2:  Log likelihood = -7327.3227  
Iteration 3:  Log likelihood = -7327.3227  

Logistic regression                                     Number of obs = 10,854
                                                        LR chi2(4)    =  22.30
                                                        Prob > chi2   = 0.0002
Log likelihood = -7327.3227                             Pseudo R2     = 0.0015

------------------------------------------------------------------------------
    purchase | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    probLOSS |   -.709517   .4620752    -1.54   0.125    -1.615168    .1961337
  amountLOSS |   .0023167   .0033999     0.68   0.496     -.004347    .0089804
     loading |  -.2157564   .0767556    -2.81   0.005    -.3661946   -.0653181
           m |   -.192775   .0678763    -2.84   0.005    -.3258101     -.05974
       _cons |   .4968946   .1176089     4.22   0.000     .2663853    .7274038
------------------------------------------------------------------------------

. 
. * Figure 6
. local fload "-.3 "-0.3" -0.2 "-0.2" 0 "0" .2 "+0.2" .3 "+0.3""

. margins, at(loading=(-0.5 -0.3 -0.2 0 0.2 0.3)) contrast(atcontrast(r) ci pv)

Contrasts of predictive margins                         Number of obs = 10,854
Model VCE: OIM

Expression: Pr(purchase), predict()
1._at: loading = -.5
2._at: loading = -.3
3._at: loading = -.2
4._at: loading =   0
5._at: loading =  .2
6._at: loading =  .3

------------------------------------------------
             |         df        chi2     P>chi2
-------------+----------------------------------
         _at |
   (2 vs 1)  |          1        8.15     0.0043
   (3 vs 1)  |          1        8.11     0.0044
   (4 vs 1)  |          1        8.03     0.0046
   (5 vs 1)  |          1        7.97     0.0048
   (6 vs 1)  |          1        7.94     0.0048
      Joint  |          2      338.68     0.0000
------------------------------------------------

-----------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.      z    P>|z|
-------------+---------------------------------------
         _at |
   (2 vs 1)  |   -.010262   .0035944    -2.86   0.004
   (3 vs 1)  |  -.0154282    .005418    -2.85   0.004
   (4 vs 1)  |  -.0258256   .0091127    -2.83   0.005
   (5 vs 1)  |  -.0363025   .0128629    -2.82   0.005
   (6 vs 1)  |   -.041568   .0147558    -2.82   0.005
-----------------------------------------------------

--------------------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.     [95% conf. interval]
-------------+------------------------------------------------
         _at |
   (2 vs 1)  |   -.010262   .0035944     -.0173069   -.0032172
   (3 vs 1)  |  -.0154282    .005418     -.0260474   -.0048091
   (4 vs 1)  |  -.0258256   .0091127     -.0436862    -.007965
   (5 vs 1)  |  -.0363025   .0128629     -.0615133   -.0110917
   (6 vs 1)  |   -.041568   .0147558     -.0704889   -.0126472
--------------------------------------------------------------

. marginsplot, xlabel(`fload') yline(0, lpattern(dash) lcolor(red)) ytitle("Effect on" "Probability" "of Purchase", orient(horizontal)) ylabel(, angle(horizontal)) title ("") xtitle("Fractional loading by desig
> n, compared to -0.5", margin(medium)) plotopts(mcolor(blue) lcolor(blue)) ciopts(lcolor(blue)) saving(loadingALL.gph, replace)

Variables that uniquely identify margins: loading
file loadingALL.gph saved

. gr export loadingALL.png, replace
file loadingALL.png saved as PNG format

. 
. * Figure 7
. local match ".2 "0.2" 0.4 "0.2" .6 "0.6" .8 "0.8" 1 "1""

. margins, at(m=(0 0.2 0.4 0.6 0.8 1)) contrast(atcontrast(r) ci pv)

Contrasts of predictive margins                         Number of obs = 10,854
Model VCE: OIM

Expression: Pr(purchase), predict()
1._at: m =  0
2._at: m = .2
3._at: m = .4
4._at: m = .6
5._at: m = .8
6._at: m =  1

------------------------------------------------
             |         df        chi2     P>chi2
-------------+----------------------------------
         _at |
   (2 vs 1)  |          1        8.46     0.0036
   (3 vs 1)  |          1        8.37     0.0038
   (4 vs 1)  |          1        8.29     0.0040
   (5 vs 1)  |          1        8.22     0.0041
   (6 vs 1)  |          1        8.16     0.0043
      Joint  |          2      403.80     0.0000
------------------------------------------------

-----------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.      z    P>|z|
-------------+---------------------------------------
         _at |
   (2 vs 1)  |  -.0091076   .0031317    -2.91   0.004
   (3 vs 1)  |  -.0182938   .0063231    -2.89   0.004
   (4 vs 1)  |  -.0275529   .0095681    -2.88   0.004
   (5 vs 1)  |  -.0368787   .0128604    -2.87   0.004
   (6 vs 1)  |  -.0462649   .0161934    -2.86   0.004
-----------------------------------------------------

--------------------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.     [95% conf. interval]
-------------+------------------------------------------------
         _at |
   (2 vs 1)  |  -.0091076   .0031317     -.0152456   -.0029696
   (3 vs 1)  |  -.0182938   .0063231     -.0306869   -.0059008
   (4 vs 1)  |  -.0275529   .0095681     -.0463061   -.0087997
   (5 vs 1)  |  -.0368787   .0128604     -.0620847   -.0116727
   (6 vs 1)  |  -.0462649   .0161934     -.0780035   -.0145264
--------------------------------------------------------------

. marginsplot, xlabel(`match') yline(0, lpattern(dash) lcolor(red)) ytitle("Effect on" "Probability" "of Purchase", orient(horizontal)) ylabel(, angle(horizontal)) title ("") xtitle("Index matching probability,
>  compared to 0", margin(medium)) plotopts(mcolor(blue) lcolor(blue)) ciopts(lcolor(blue)) saving(matchingALL.gph, replace)

Variables that uniquely identify margins: m
file matchingALL.gph saved

. gr export matchingALL.png, replace
file matchingALL.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:08
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. 
. ***********************************************************************************
. * Analysis if purchase using regressions
. ***********************************************************************************
. 
. * Regression that we use to say that each ROCL violation reduced insurance purchase by 2 pp with p-value of 0.085 in page 23
. 
. log on app
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:08

. 
. * Figure 5
. 
. * regressions
. xtlogit purchase i.roclkill##i.ii_ae $demog_reg $actuarial_norm, vce(cluster SID_all)

Fitting comparison model:

Iteration 0:  Log pseudolikelihood = -7338.4711  
Iteration 1:  Log pseudolikelihood =   -7250.88  
Iteration 2:  Log pseudolikelihood = -7250.6531  
Iteration 3:  Log pseudolikelihood = -7250.6531  

Fitting full model:

tau =  0.0    Log pseudolikelihood = -7250.6531
tau =  0.1    Log pseudolikelihood = -6692.4117
tau =  0.2    Log pseudolikelihood = -6532.8956
tau =  0.3    Log pseudolikelihood = -6460.7693
tau =  0.4    Log pseudolikelihood = -6426.3752
tau =  0.5    Log pseudolikelihood = -6415.9647
tau =  0.6    Log pseudolikelihood = -6428.1829

Iteration 0:  Log pseudolikelihood =  -6407.598  
Iteration 1:  Log pseudolikelihood = -6402.2081  
Iteration 2:  Log pseudolikelihood = -6402.1757  
Iteration 3:  Log pseudolikelihood = -6402.1757  

Calculating robust standard errors ...

Random-effects logistic regression                   Number of obs    = 10,854
Group variable: SID_all                              Number of groups =    201

Random effects u_i ~ Gaussian                        Obs per group:
                                                                  min =     54
                                                                  avg =   54.0
                                                                  max =     54

Integration method: mvaghermite                      Integration pts. =     12

                                                     Wald chi2(15)    =  25.53
Log pseudolikelihood = -6402.1757                    Prob > chi2      = 0.0433

                                    (Std. err. adjusted for 201 clusters in SID_all)
------------------------------------------------------------------------------------
                   |               Robust
          purchase | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
        1.roclkill |   .0782194   .3294468     0.24   0.812    -.5674845    .7239233
                   |
             ii_ae |
  Index Insurance  |  -.1014451   .1959356    -0.52   0.605    -.4854717    .2825816
                   |
    roclkill#ii_ae |
1#Index Insurance  |    .809106   .5140134     1.57   0.115    -.1983418    1.816554
                   |
            female |   -.246185   .1802845    -1.37   0.172    -.5995362    .1071662
               age |   .0154706   .0144094     1.07   0.283    -.0127712    .0437125
             black |   .1434297   .2106321     0.68   0.496    -.2694016     .556261
          business |  -.0520095   .1965198    -0.26   0.791    -.4371812    .3331623
            single |  -.4088767   .2868079    -1.43   0.154    -.9710099    .1532566
              nhhd |  -.0560495   .0491956    -1.14   0.255    -.1524711    .0403722
           working |  -.0299504   .1999083    -0.15   0.881    -.4217636    .3618627
             money |  -.0005414    .009062    -0.06   0.952    -.0183026    .0172198
      probLOSSnorm |  -.0367842   .0535352    -0.69   0.492    -.1417112    .0681428
    amountLOSSnorm |  -.1086192   .1040628    -1.04   0.297    -.3125784    .0953401
       loadingnorm |  -.1520991   .0782974    -1.94   0.052    -.3055593     .001361
             mnorm |  -.1106443   .0677017    -1.63   0.102    -.2433372    .0220487
             _cons |    1.05823   .4647791     2.28   0.023     .1472796     1.96918
-------------------+----------------------------------------------------------------
          /lnsig2u |   .3254713   .1704883                     -.0086796    .6596221
-------------------+----------------------------------------------------------------
           sigma_u |   1.176726   .1003089                      .9956696    1.390705
               rho |   .2962173   .0355421                      .2315594    .3702311
------------------------------------------------------------------------------------

. margins, dydx(1.roclkill) at(ii_ae=(0 1)) level(95) post // +30pp, sig

Average marginal effects                                Number of obs = 10,854
Model VCE: Robust

Expression: Pr(purchase=1), predict(pr)
dy/dx wrt:  1.roclkill
1._at: ii_ae = 0
2._at: ii_ae = 1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
0.roclkill   |  (base outcome)
-------------+----------------------------------------------------------------
1.roclkill   |
         _at |
          1  |   .0147363   .0618856     0.24   0.812    -.1065573      .13603
          2  |   .1581504   .0617615     2.56   0.010     .0371001    .2792007
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. est sto purch_roclkill

. 
. * Figure B
. coefplot (purch_roclkill, mcolor(dknavy) ciopts(lcol(dknavy)) mlabels(1.roclkill:1._at=1 "ROCL violators" 1.roclkill:2._at=1 "ROCL violators") mlabtextstyle(heading) ), drop(_cons $actuarial_norm $demog_reg) 
> xline(0) xtitle("Change in Purchase Probability", margin(small)) xscale(range(-0.1 0.3)) xlabel(-0.1(0.1)0.3) nokey levels(95) mlabposition(12) coeflabels(1._at = "AE" 2._at = "II") saving(FigB_purchrocl.gph,
>  replace)
file FigB_purchrocl.gph saved

. gr export FigB_purchrocl.png, replace
file FigB_purchrocl.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:22
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. 
. 
. ////////////////////////////////////////////////////////////////////////////////
> ///////////////////////.   Efficiency ///////////////////////////////////
> ////////////////////////////////////////////////////////////////////////////////
> 
. * Tabulations of efficiency measure by treatment 
. sum eff_reg_RDU if ii_ae == 0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |        111    .4689601    .1921497   .0618333   .9706801

. sum eff_reg_RDU if ii_ae == 1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         79    .4814185    .1862098      .0001   .9951162

. ttest  eff_reg_RDU if record == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |     111    .4689601     .018238    .1921497    .4328166    .5051037
Index In |      79    .4814185    .0209502    .1862098    .4397098    .5231273
---------+--------------------------------------------------------------------
Combined |     190    .4741402    .0137337    .1893054    .4470493    .5012312
---------+--------------------------------------------------------------------
    diff |           -.0124584    .0279246               -.0675442    .0426275
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =  -0.4461
H0: diff = 0                                     Degrees of freedom =      188

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.3280         Pr(|T| > |t|) = 0.6560          Pr(T > t) = 0.6720

. 
. * Efficiency across treatments of ROCL compliers
. sum eff_reg_RDU if ii_ae == 0 & roclkill==0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         86     .470112    .1879737   .0618333   .9706801

. sum eff_reg_RDU if ii_ae == 1 & roclkill==0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         63     .503721    .1750349   .1398842   .9951162

. * Difference in means test ROCL compliers
. ttest  eff_reg_RDU if roclkill==0  & record == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |      86     .470112    .0202697    .1879737    .4298104    .5104136
Index In |      63     .503721    .0220523    .1750349    .4596391     .547803
---------+--------------------------------------------------------------------
Combined |     149    .4843225    .0149732    .1827711    .4547337    .5139114
---------+--------------------------------------------------------------------
    diff |            -.033609     .030286               -.0934612    .0262431
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =  -1.1097
H0: diff = 0                                     Degrees of freedom =      147

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.1345         Pr(|T| > |t|) = 0.2689          Pr(T > t) = 0.8655

. 
. * Efficiency across treatments of ROCL violators
. sum eff_reg_RDU if ii_ae == 0 & roclkill==1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         25    .4649977    .2099067   .0884103    .964451

. sum eff_reg_RDU if ii_ae == 1 & roclkill==1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         16    .3936023    .2082225      .0001   .6666803

. * Difference in means test ROCL violators
. ttest  eff_reg_RDU if roclkill==1  & record == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |      25    .4649977    .0419813    .2099067    .3783525     .551643
Index In |      16    .3936023    .0520556    .2082225    .2826484    .5045563
---------+--------------------------------------------------------------------
Combined |      41    .4371361    .0327364     .209615    .3709735    .5032988
---------+--------------------------------------------------------------------
    diff |            .0713954    .0669961               -.0641169    .2069077
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =   1.0657
H0: diff = 0                                     Degrees of freedom =       39

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.8534         Pr(|T| > |t|) = 0.2931          Pr(T > t) = 0.1466

. 
. log on app
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:22

. 
. * Tabulations for comparisons of means across treatments in page 33
. 
. * Efficiency in II treatments of ROCL violators and ROCL compliers
. sum eff_reg_RDU if ii_ae == 1 & roclkill==1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         16    .3936023    .2082225      .0001   .6666803

. sum eff_reg_RDU if ii_ae == 1 & roclkill==0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         63     .503721    .1750349   .1398842   .9951162

. 
. * Efficiency in II treatments of ROCL violators and ROCL compliers
. sum eff_reg_RDU if ii_ae == 0 & roclkill==1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         25    .4649977    .2099067   .0884103    .964451

. sum eff_reg_RDU if ii_ae == 0 & roclkill==0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         86     .470112    .1879737   .0618333   .9706801

. 
. 
. * log for Figure 8
. betareg eff_reg_RDU i.ii_ae $demog_reg if record==1
Initial:      Log likelihood =  28.774537
Rescale:      Log likelihood =  28.774537
Rescale eq:   Log likelihood =  28.774537
(setting technique to bhhh)
Iteration 0:  Log likelihood =  28.774537  
Iteration 1:  Log likelihood =  31.725075  
Iteration 2:  Log likelihood =  32.093591  
Iteration 3:  Log likelihood =  32.357689  
Iteration 4:  Log likelihood =   32.65725  
Iteration 5:  Log likelihood =  32.805385  
Iteration 6:  Log likelihood =  32.825365  
Iteration 7:  Log likelihood =  32.856725  
Iteration 8:  Log likelihood =  32.978698  
Iteration 9:  Log likelihood =  33.003825  
(switching technique to nr)
Iteration 10: Log likelihood =  33.017046  
Iteration 11: Log likelihood =  33.074422  
Iteration 12: Log likelihood =   33.07444  
Iteration 13: Log likelihood =   33.07444  

Beta regression                                 Number of obs     =        190
                                                LR chi2(9)        =       4.68
                                                Prob > chi2       =     0.8613

Link function  :  g(u) = log(u/(1-u))           [Logit]
Slink function :  g(u) = log(u)                 [Log]

Log likelihood =   33.07444

----------------------------------------------------------------------------------
     eff_reg_RDU | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-----------------+----------------------------------------------------------------
eff_reg_RDU      |
           ii_ae |
Index Insurance  |  -.0493892   .1256209    -0.39   0.694    -.2956018    .1968233
          female |   .0082945   .1272979     0.07   0.948    -.2412047    .2577938
             age |  -.0081141   .0104511    -0.78   0.438    -.0285978    .0123697
           black |   .0664592     .14341     0.46   0.643    -.2146192    .3475376
        business |   .0309119   .1397538     0.22   0.825    -.2430006    .3048244
          single |  -.0724424   .1963075    -0.37   0.712     -.457198    .3123131
            nhhd |  -.0074174   .0330271    -0.22   0.822    -.0721492    .0573145
         working |   .1632653   .1304555     1.25   0.211    -.0924229    .4189534
           money |   -.009098    .006075    -1.50   0.134    -.0210048    .0028089
           _cons |   .0652943   .3450684     0.19   0.850    -.6110273    .7416159
-----------------+----------------------------------------------------------------
scale            |
           _cons |   1.516305   .0933624    16.24   0.000     1.333318    1.699291
----------------------------------------------------------------------------------

. 
. *significant differences
. betareg eff_reg_RDU i.roclkill##i.ii_ae $demog_reg if record==1
Initial:      Log likelihood =  37.478155
Rescale:      Log likelihood =  37.478155
Rescale eq:   Log likelihood =  37.478155
(setting technique to bhhh)
Iteration 0:  Log likelihood =  37.478155  
Iteration 1:  Log likelihood =  39.597548  
Iteration 2:  Log likelihood =  39.868847  
Iteration 3:  Log likelihood =  39.938953  
Iteration 4:  Log likelihood =  40.100349  
Iteration 5:  Log likelihood =  40.110776  
Iteration 6:  Log likelihood =  40.131047  
Iteration 7:  Log likelihood =  40.136093  
Iteration 8:  Log likelihood =  40.136355  
Iteration 9:  Log likelihood =  40.142745  
(switching technique to nr)
Iteration 10: Log likelihood =  40.143911  
Iteration 11: Log likelihood =  40.147631  
Iteration 12: Log likelihood =  40.147631  

Beta regression                                 Number of obs     =        190
                                                LR chi2(11)       =      18.83
                                                Prob > chi2       =     0.0643

Link function  :  g(u) = log(u/(1-u))           [Logit]
Slink function :  g(u) = log(u)                 [Log]

Log likelihood =  40.147631

------------------------------------------------------------------------------------
       eff_reg_RDU | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
eff_reg_RDU        |
        1.roclkill |  -.0492879   .1903587    -0.26   0.796     -.422384    .3238083
                   |
             ii_ae |
  Index Insurance  |   .1397011    .138322     1.01   0.313    -.1314051    .4108072
                   |
    roclkill#ii_ae |
1#Index Insurance  |  -.8441682     .30557    -2.76   0.006    -1.443074   -.2452621
                   |
            female |   .1138808   .1277349     0.89   0.373     -.136475    .3642367
               age |  -.0051358   .0101918    -0.50   0.614    -.0251113    .0148397
             black |   .0292486   .1409116     0.21   0.836    -.2469331    .3054303
          business |   .0567831   .1377286     0.41   0.680      -.21316    .3267263
            single |  -.0489689   .1908016    -0.26   0.797    -.4229331    .3249954
              nhhd |    .001153   .0321953     0.04   0.971    -.0619485    .0642546
           working |   .1636066   .1272152     1.29   0.198    -.0857306    .4129437
             money |  -.0106892   .0058934    -1.81   0.070    -.0222401    .0008617
             _cons |  -.0332952   .3362917    -0.10   0.921    -.6924147    .6258244
-------------------+----------------------------------------------------------------
scale              |
             _cons |   1.590167   .0940103    16.91   0.000     1.405911    1.774424
------------------------------------------------------------------------------------

. 
. * text -- be careful with the 1 and 2 here, read the labels!
. margins, dydx(1.roclkill) at(ii_ae=(0 1)) level(95) post

Average marginal effects                                   Number of obs = 190
Model VCE: OIM

Expression: Conditional mean of eff_reg_RDU, predict()
dy/dx wrt:  1.roclkill
1._at: ii_ae = 0
2._at: ii_ae = 1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
0.roclkill   |  (base outcome)
-------------+----------------------------------------------------------------
1.roclkill   |
         _at |
          1  |  -.0122247   .0471691    -0.26   0.796    -.1046744    .0802251
          2  |  -.2109324   .0526422    -4.01   0.000    -.3141093   -.1077555
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. est sto eff_roclkill

. 
. * Figure 8
. local welf "-.4 "-0.4" -.3 "-0.3" -0.2 "-0.2" -.1 "-0.1" 0 "0" .1 "+0.1" .2 "+0.2""

. coefplot (eff_roclkill, mcolor(dknavy) ciopts(lcol(dknavy)) mlabels(1.roclkill:1._at=1 "ROCL violators" 1.roclkill:2._at=1 "ROCL violators") mlabtextstyle(heading) ), drop(_cons $actuarial_norm $demog_reg) xl
> ine(0) xscale(range(-0.4 0.2)) xlabel(`welf') nokey levels(95) mlabposition(12) coeflabels(1._at = "AE" 2._at = "II") saving(FigD.gph, replace)
file FigD.gph saved

. gr export FigD.png, replace
file FigD.png saved as PNG format

. 
. * log for Figure 9
. 
. *significant differences
. betareg eff_reg_recRDU i.roclkill##i.ii_ae $demog_reg if record==1
Initial:      Log likelihood =  8.8634834
Rescale:      Log likelihood =  9.6479029
Rescale eq:   Log likelihood =  9.6479029
(setting technique to bhhh)
Iteration 0:  Log likelihood =  9.6479029  
Iteration 1:  Log likelihood =  13.197411  
Iteration 2:  Log likelihood =  14.409746  
Iteration 3:  Log likelihood =  14.567944  
Iteration 4:  Log likelihood =  15.068438  
Iteration 5:  Log likelihood =  15.219643  
Iteration 6:  Log likelihood =  15.649594  
Iteration 7:  Log likelihood =   15.77517  
Iteration 8:  Log likelihood =  16.013782  
Iteration 9:  Log likelihood =   16.10472  
(switching technique to nr)
Iteration 10: Log likelihood =   16.24738  
Iteration 11: Log likelihood =  17.092085  
Iteration 12: Log likelihood =   17.09556  
Iteration 13: Log likelihood =   17.09556  

Beta regression                                 Number of obs     =        181
                                                LR chi2(11)       =      12.96
                                                Prob > chi2       =     0.2957

Link function  :  g(u) = log(u/(1-u))           [Logit]
Slink function :  g(u) = log(u)                 [Log]

Log likelihood =   17.09556

------------------------------------------------------------------------------------
    eff_reg_recRDU | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
eff_reg_recRDU     |
        1.roclkill |  -.2384134   .2408626    -0.99   0.322    -.7104954    .2336685
                   |
             ii_ae |
  Index Insurance  |   .0265649    .175179     0.15   0.879    -.3167796    .3699094
                   |
    roclkill#ii_ae |
1#Index Insurance  |   -.357993   .3809638    -0.94   0.347    -1.104668    .3886823
                   |
            female |  -.0421087   .1602878    -0.26   0.793     -.356267    .2720495
               age |  -.0069181   .0127288    -0.54   0.587    -.0318662    .0180299
             black |   .0040398    .173945     0.02   0.981    -.3368861    .3449657
          business |  -.0229308   .1682978    -0.14   0.892    -.3527884    .3069269
            single |   .1957102   .2501477     0.78   0.434    -.2945704    .6859908
              nhhd |   .0814692   .0395836     2.06   0.040     .0038868    .1590517
           working |   .1644292   .1597586     1.03   0.303     -.148692    .4775503
             money |   -.001115    .007309    -0.15   0.879    -.0154404    .0132104
             _cons |  -.6318233    .425736    -1.48   0.138    -1.466251    .2026039
-------------------+----------------------------------------------------------------
scale              |
             _cons |   1.035313   .0925997    11.18   0.000      .853821    1.216805
------------------------------------------------------------------------------------

. 
. * text -- be careful with the 1 and 2 here, read the labels!
. margins, dydx(1.roclkill) at(ii_ae=(0 1)) level(95) post

Average marginal effects                                   Number of obs = 181
Model VCE: OIM

Expression: Conditional mean of eff_reg_recRDU, predict()
dy/dx wrt:  1.roclkill
1._at: ii_ae = 0
2._at: ii_ae = 1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
0.roclkill   |  (base outcome)
-------------+----------------------------------------------------------------
1.roclkill   |
         _at |
          1  |  -.0568437    .056574    -1.00   0.315    -.1677267    .0540394
          2  |  -.1368708   .0647968    -2.11   0.035    -.2638702   -.0098715
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. est sto eff_roclkill_recRDU

. 
. * Figure 9
. local welf "-.4 "-0.4" -.3 "-0.3" -0.2 "-0.2" -.1 "-0.1" 0 "0" .1 "+0.1" .2 "+0.2""

. coefplot (eff_roclkill_recRDU, mcolor(dknavy) ciopts(lcol(dknavy)) mlabels(1.roclkill:1._at=1 "ROCL violators" 1.roclkill:2._at=1 "ROCL violators") mlabtextstyle(heading) ), drop(_cons $actuarial_norm $demog_
> reg) xline(0) xscale(range(-0.4 0.2)) xlabel(`welf') nokey levels(95) mlabposition(12) coeflabels(1._at = "AE" 2._at = "II") saving(FigE.gph, replace)
file FigE.gph saved

. gr export FigE.png, replace
file FigE.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:26
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. 
. * tidy up
. capture: erase tmp.dta

. 
. log close app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 closed on:  20 Apr 2025, 13:35:26
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

. log close all
      name:  all
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- 20 Apr 2025.log
  log type:  text
 closed on:  20 Apr 2025, 13:35:26
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
